VuFind \ Exception \ RecordMissing
Record Solr:UFV_37025e0639c489933043de8f898ed3c8 does not exist. VuFind\Exception\RecordMissing thrown with message "Record Solr:UFV_37025e0639c489933043de8f898ed3c8 does not exist." Stacktrace: #13 VuFind\Exception\RecordMissing in /usr/local/bdtd-vufind/module/VuFind/src/VuFind/Record/Loader.php:180 #12 VuFind\Record\Loader:load in /usr/local/bdtd-vufind/module/VuFind/src/VuFind/Controller/AbstractRecord.php:659 #11 VuFind\Controller\AbstractRecord:loadRecord in /usr/local/bdtd-vufind/module/VuFind/src/VuFind/Controller/AbstractRecord.php:692 #10 VuFind\Controller\AbstractRecord:loadTabDetails in /usr/local/bdtd-vufind/module/VuFind/src/VuFind/Controller/AbstractRecord.php:712 #9 VuFind\Controller\AbstractRecord:getDefaultTab in /usr/local/bdtd-vufind/module/VuFind/src/VuFind/Controller/AbstractRecord.php:295 #8 VuFind\Controller\AbstractRecord:homeAction in /usr/local/bdtd-vufind/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php:77 #7 Laminas\Mvc\Controller\AbstractActionController:onDispatch in /usr/local/bdtd-vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:321 #6 Laminas\EventManager\EventManager:triggerListeners in /usr/local/bdtd-vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:178 #5 Laminas\EventManager\EventManager:triggerEventUntil in /usr/local/bdtd-vufind/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php:103 #4 Laminas\Mvc\Controller\AbstractController:dispatch in /usr/local/bdtd-vufind/vendor/laminas/laminas-mvc/src/DispatchListener.php:139 #3 Laminas\Mvc\DispatchListener:onDispatch in /usr/local/bdtd-vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:321 #2 Laminas\EventManager\EventManager:triggerListeners in /usr/local/bdtd-vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:178 #1 Laminas\EventManager\EventManager:triggerEventUntil in /usr/local/bdtd-vufind/vendor/laminas/laminas-mvc/src/Application.php:331 #0 Laminas\Mvc\Application:run in /usr/local/bdtd-vufind/public/index.php:88
13
VuFind\Exception\RecordMissing
/module/VuFind/src/VuFind/Record/Loader.php180
12
VuFind\Record\Loader load
/module/VuFind/src/VuFind/Controller/AbstractRecord.php659
11
VuFind\Controller\AbstractRecord loadRecord
/module/VuFind/src/VuFind/Controller/AbstractRecord.php692
10
VuFind\Controller\AbstractRecord loadTabDetails
/module/VuFind/src/VuFind/Controller/AbstractRecord.php712
9
VuFind\Controller\AbstractRecord getDefaultTab
/module/VuFind/src/VuFind/Controller/AbstractRecord.php295
8
VuFind\Controller\AbstractRecord homeAction
/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php77
7
Laminas\Mvc\Controller\AbstractActionController onDispatch
/vendor/laminas/laminas-eventmanager/src/EventManager.php321
6
Laminas\EventManager\EventManager triggerListeners
/vendor/laminas/laminas-eventmanager/src/EventManager.php178
5
Laminas\EventManager\EventManager triggerEventUntil
/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php103
4
Laminas\Mvc\Controller\AbstractController dispatch
/vendor/laminas/laminas-mvc/src/DispatchListener.php139
3
Laminas\Mvc\DispatchListener onDispatch
/vendor/laminas/laminas-eventmanager/src/EventManager.php321
2
Laminas\EventManager\EventManager triggerListeners
/vendor/laminas/laminas-eventmanager/src/EventManager.php178
1
Laminas\EventManager\EventManager triggerEventUntil
/vendor/laminas/laminas-mvc/src/Application.php331
0
Laminas\Mvc\Application run
/public/index.php88
        }
        if ($tolerateMissing) {
            $record = $this->recordFactory->get('Missing');
            $record->setRawData(['id' => $id]);
            $record->setSourceIdentifier($source);
            return $record;
        }
        $newId = $this->loadNewIdFromAPI($id);
        if ($newId) {
            return $this->load($newId);
        } else {
            $record = $this->loadMissedFromAPI($id);
            if ($record) {
                $fields = json_decode(json_encode($record), true);
                $solrDefault = new SolrDefault();
                $solrDefault->setRawData($fields);
                return $solrDefault;
            }
        }
        throw new RecordMissingException(
            'Record ' . $source . ':' . $id . ' does not exist.'
        );
    }
 
    // Se o id mudou vamos procurar o novo id na API externa
    public function loadNewIdFromAPI($id)
    {
        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $this->config->Oasisbr->oasisbr_api . "ids/" . $id,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "GET",
            CURLOPT_HTTPHEADER => array(
                "cache-control: no-cache"
            ),
        ));
 
        $response = curl_exec($curl);
     * @param ParamBag $params Search backend parameters
     * @param bool     $force  Set to true to force a reload of the record, even if
     * already loaded (useful if loading a record using different parameters)
     *
     * @return AbstractRecordDriver
     */
    protected function loadRecord(ParamBag $params = null, bool $force = false)
    {
        // Only load the record if it has not already been loaded.  Note that
        // when determining record ID, we check both the route match (the most
        // common scenario) and the GET parameters (a fallback used by some
        // legacy routes).
        if ($force || !is_object($this->driver)) {
            $recordLoader = $this->getRecordLoader();
            $cacheContext = $this->getRequest()->getQuery()->get('cacheContext');
            if (isset($cacheContext)) {
                $recordLoader->setCacheContext($cacheContext);
            }
            $this->driver = $recordLoader->load(
                $this->params()->fromRoute('id', $this->params()->fromQuery('id')),
                $this->searchClassId,
                false,
                $params
            );
        }
        return $this->driver;
    }
 
    /**
     * Redirect the user to the main record view.
     *
     * @param string $params Parameters to append to record URL.
     * @param string $tab    Record tab to display (null for default).
     *
     * @return mixed
     */
    protected function redirectToRecord($params = '', $tab = null)
    {
        $details = $this->getRecordRouter()
            ->getTabRouteDetails($this->loadRecord(), $tab);
     *
     * @return mixed
     */
    protected function redirectToRecord($params = '', $tab = null)
    {
        $details = $this->getRecordRouter()
            ->getTabRouteDetails($this->loadRecord(), $tab);
        $target = $this->url()->fromRoute($details['route'], $details['params']);
 
        return $this->redirect()->toUrl($target . $params);
    }
 
    /**
     * Support method to load tab information from the RecordTab PluginManager.
     *
     * @return void
     */
    protected function loadTabDetails()
    {
        $driver = $this->loadRecord();
        $request = $this->getRequest();
        $manager = $this->getRecordTabManager();
        $details = $manager
            ->getTabDetailsForRecord($driver, $request, $this->fallbackDefaultTab);
        $this->allTabs = $details['tabs'];
        $this->defaultTab = $details['default'] ? $details['default'] : false;
        $this->backgroundTabs = $manager->getBackgroundTabNames($driver);
        $this->tabsExtraScripts = $manager->getExtraScripts();
    }
 
    /**
     * Get default tab for a given driver
     *
     * @return string
     */
    protected function getDefaultTab()
    {
        // Load default tab if not already retrieved:
        if (null === $this->defaultTab) {
            $this->loadTabDetails();
        $request = $this->getRequest();
        $manager = $this->getRecordTabManager();
        $details = $manager
            ->getTabDetailsForRecord($driver, $request, $this->fallbackDefaultTab);
        $this->allTabs = $details['tabs'];
        $this->defaultTab = $details['default'] ? $details['default'] : false;
        $this->backgroundTabs = $manager->getBackgroundTabNames($driver);
        $this->tabsExtraScripts = $manager->getExtraScripts();
    }
 
    /**
     * Get default tab for a given driver
     *
     * @return string
     */
    protected function getDefaultTab()
    {
        // Load default tab if not already retrieved:
        if (null === $this->defaultTab) {
            $this->loadTabDetails();
        }
        return $this->defaultTab;
    }
 
    /**
     * Get all tab information for a given driver.
     *
     * @return array
     */
    protected function getAllTabs()
    {
        if (null === $this->allTabs) {
            $this->loadTabDetails();
        }
        return $this->allTabs;
    }
 
    /**
     * Get names of tabs to be loaded in the background.
     *
        if ($checkRoute && $config->Collections->collections ?? false) {
            $routeConfig = isset($config->Collections->route)
                ? $config->Collections->route->toArray() : [];
            $collectionRoutes
                = array_merge(['record' => 'collection'], $routeConfig);
            $routeName = $this->event->getRouteMatch()->getMatchedRouteName() ?? '';
            if ($collectionRoute = ($collectionRoutes[$routeName] ?? null)) {
                $driver = $this->loadRecord();
                if (true === $driver->tryMethod('isCollection')) {
                    $params = $this->params()->fromQuery()
                        + $this->params()->fromRoute();
                    $collectionUrl = $this->url()
                        ->fromRoute($collectionRoute, $params);
                    return $this->redirect()->toUrl($collectionUrl);
                }
            }
        }
 
        return $this->showTab(
            $this->params()->fromRoute('tab', $this->getDefaultTab())
        );
    }
 
    /**
     * AJAX tab action -- render a tab without surrounding context.
     *
     * @return mixed
     */
    public function ajaxtabAction()
    {
        $this->loadRecord();
        // Set layout to render content only:
        $this->layout()->setTemplate('layout/lightbox');
        return $this->showTab(
            $this->params()->fromPost('tab', $this->getDefaultTab()), true
        );
    }
 
    /**
     * ProcessSave -- store the results of the Save action.
     */
    public function onDispatch(MvcEvent $e)
    {
        $routeMatch = $e->getRouteMatch();
        if (! $routeMatch) {
            /**
             * @todo Determine requirements for when route match is missing.
             *       Potentially allow pulling directly from request metadata?
             */
            throw new Exception\DomainException('Missing route matches; unsure how to retrieve action');
        }
 
        $action = $routeMatch->getParam('action', 'not-found');
        $method = static::getMethodFromAction($action);
 
        if (! method_exists($this, $method)) {
            $method = 'notFoundAction';
        }
 
        $actionResponse = $this->$method();
 
        $e->setResult($actionResponse);
 
        return $actionResponse;
    }
}
 
        }
 
        if ($this->sharedManager) {
            foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
                $listOfListenersByPriority[$priority][] = $listeners;
            }
        }
 
        // Sort by priority in reverse order
        krsort($listOfListenersByPriority);
 
        // Initial value of stop propagation flag should be false
        $event->stopPropagation(false);
 
        // Execute listeners
        $responses = new ResponseCollection();
        foreach ($listOfListenersByPriority as $listOfListeners) {
            foreach ($listOfListeners as $listeners) {
                foreach ($listeners as $listener) {
                    $response = $listener($event);
                    $responses->push($response);
 
                    // If the event was asked to stop propagating, do so
                    if ($event->propagationIsStopped()) {
                        $responses->setStopped(true);
                        return $responses;
                    }
 
                    // If the result causes our validation callback to return true,
                    // stop propagation
                    if ($callback && $callback($response)) {
                        $responses->setStopped(true);
                        return $responses;
                    }
                }
            }
        }
 
        return $responses;
    }
            $event->setParams($argv);
        }
 
        return $this->triggerListeners($event, $callback);
    }
 
    /**
     * @inheritDoc
     */
    public function triggerEvent(EventInterface $event)
    {
        return $this->triggerListeners($event);
    }
 
    /**
     * @inheritDoc
     */
    public function triggerEventUntil(callable $callback, EventInterface $event)
    {
        return $this->triggerListeners($event, $callback);
    }
 
    /**
     * @inheritDoc
     */
    public function attach($eventName, callable $listener, $priority = 1)
    {
        if (! is_string($eventName)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects a string for the event; received %s',
                __METHOD__,
                (is_object($eventName) ? get_class($eventName) : gettype($eventName))
            ));
        }
 
        $this->events[$eventName][(int) $priority][0][] = $listener;
        return $listener;
    }
 
    /**
     * @events dispatch.pre, dispatch.post
     * @param  Request $request
     * @param  null|Response $response
     * @return Response|mixed
     */
    public function dispatch(Request $request, Response $response = null)
    {
        $this->request = $request;
        if (! $response) {
            $response = new HttpResponse();
        }
        $this->response = $response;
 
        $e = $this->getEvent();
        $e->setName(MvcEvent::EVENT_DISPATCH);
        $e->setRequest($request);
        $e->setResponse($response);
        $e->setTarget($this);
 
        $result = $this->getEventManager()->triggerEventUntil(function ($test) {
            return ($test instanceof Response);
        }, $e);
 
        if ($result->stopped()) {
            return $result->last();
        }
 
        return $e->getResult();
    }
 
    /**
     * Get request object
     *
     * @return Request
     */
    public function getRequest()
    {
        if (! $this->request) {
            $this->request = new HttpRequest();
        }
            );
            return $this->complete($return, $e);
        } catch (\Throwable $exception) {
            $return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
            return $this->complete($return, $e);
        } catch (\Exception $exception) {  // @TODO clean up once PHP 7 requirement is enforced
            $return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
            return $this->complete($return, $e);
        }
 
        if ($controller instanceof InjectApplicationEventInterface) {
            $controller->setEvent($e);
        }
 
        $request  = $e->getRequest();
        $response = $application->getResponse();
        $caughtException = null;
 
        try {
            $return = $controller->dispatch($request, $response);
        } catch (\Throwable $ex) {
            $caughtException = $ex;
        } catch (\Exception $ex) {  // @TODO clean up once PHP 7 requirement is enforced
            $caughtException = $ex;
        }
 
        if ($caughtException !== null) {
            $e->setName(MvcEvent::EVENT_DISPATCH_ERROR);
            $e->setError($application::ERROR_EXCEPTION);
            $e->setController($controllerName);
            $e->setControllerClass(get_class($controller));
            $e->setParam('exception', $caughtException);
 
            $return = $application->getEventManager()->triggerEvent($e)->last();
            if (! $return) {
                $return = $e->getResult();
            }
        }
 
        return $this->complete($return, $e);
        }
 
        if ($this->sharedManager) {
            foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
                $listOfListenersByPriority[$priority][] = $listeners;
            }
        }
 
        // Sort by priority in reverse order
        krsort($listOfListenersByPriority);
 
        // Initial value of stop propagation flag should be false
        $event->stopPropagation(false);
 
        // Execute listeners
        $responses = new ResponseCollection();
        foreach ($listOfListenersByPriority as $listOfListeners) {
            foreach ($listOfListeners as $listeners) {
                foreach ($listeners as $listener) {
                    $response = $listener($event);
                    $responses->push($response);
 
                    // If the event was asked to stop propagating, do so
                    if ($event->propagationIsStopped()) {
                        $responses->setStopped(true);
                        return $responses;
                    }
 
                    // If the result causes our validation callback to return true,
                    // stop propagation
                    if ($callback && $callback($response)) {
                        $responses->setStopped(true);
                        return $responses;
                    }
                }
            }
        }
 
        return $responses;
    }
            $event->setParams($argv);
        }
 
        return $this->triggerListeners($event, $callback);
    }
 
    /**
     * @inheritDoc
     */
    public function triggerEvent(EventInterface $event)
    {
        return $this->triggerListeners($event);
    }
 
    /**
     * @inheritDoc
     */
    public function triggerEventUntil(callable $callback, EventInterface $event)
    {
        return $this->triggerListeners($event, $callback);
    }
 
    /**
     * @inheritDoc
     */
    public function attach($eventName, callable $listener, $priority = 1)
    {
        if (! is_string($eventName)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects a string for the event; received %s',
                __METHOD__,
                (is_object($eventName) ? get_class($eventName) : gettype($eventName))
            ));
        }
 
        $this->events[$eventName][(int) $priority][0][] = $listener;
        return $listener;
    }
 
    /**
            $response = $result->last();
            if ($response instanceof ResponseInterface) {
                $event->setName(MvcEvent::EVENT_FINISH);
                $event->setTarget($this);
                $event->setResponse($response);
                $event->stopPropagation(false); // Clear before triggering
                $events->triggerEvent($event);
                $this->response = $response;
                return $this;
            }
        }
 
        if ($event->getError()) {
            return $this->completeRequest($event);
        }
 
        // Trigger dispatch event
        $event->setName(MvcEvent::EVENT_DISPATCH);
        $event->stopPropagation(false); // Clear before triggering
        $result = $events->triggerEventUntil($shortCircuit, $event);
 
        // Complete response
        $response = $result->last();
        if ($response instanceof ResponseInterface) {
            $event->setName(MvcEvent::EVENT_FINISH);
            $event->setTarget($this);
            $event->setResponse($response);
            $event->stopPropagation(false); // Clear before triggering
            $events->triggerEvent($event);
            $this->response = $response;
            return $this;
        }
 
        $response = $this->response;
        $event->setResponse($response);
        return $this->completeRequest($event);
    }
 
    /**
     * Complete the request
$pathParts[] = APPLICATION_PATH . '/vendor';
$pathParts[] = get_include_path();
set_include_path(implode(PATH_SEPARATOR, $pathParts));
 
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
    $loader = include 'vendor/autoload.php';
}
 
if (!class_exists('Laminas\Loader\AutoloaderFactory')) {
    throw new RuntimeException('Unable to load Laminas autoloader.');
}
 
// Run the application!
$app = Laminas\Mvc\Application::init(require 'config/application.config.php');
if (PHP_SAPI === 'cli') {
    return $app->getServiceManager()
        ->get(\VuFindConsole\ConsoleRunner::class)->run();
} else {
    $app->run();
}
 

Environment & details:

empty
empty
empty
empty
Key Value
__Laminas Array ( [_REQUEST_ACCESS_TIME] => 1710842867.1383 [_VALID] => Array ( [Laminas\Session\Validator\Id] => uuhv16ijfei3e05f3gdbruvuqo ) )
SessionState Laminas\Stdlib\ArrayObject Object ( [storage:protected] => Array ( [cookiePath] => / ) [flag:protected] => 2 [iteratorClass:protected] => ArrayIterator [protectedProperties:protected] => Array ( [0] => storage [1] => flag [2] => iteratorClass [3] => protectedProperties ) )
Key Value
REDIRECT_VUFIND_ENV development
REDIRECT_VUFIND_LOCAL_DIR /usr/local/bdtd-vufind/local
REDIRECT_VUFIND_LOCAL_MODULES Bdtd
REDIRECT_STATUS 200
VUFIND_ENV development
VUFIND_LOCAL_DIR /usr/local/bdtd-vufind/local
VUFIND_LOCAL_MODULES Bdtd
HTTP_HOST bdtd.ibict.br
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_ACCESS_CONTROL_ALLOW_ORIGIN http://barra.brasil.gov.br
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_FOR 54.242.75.224
HTTP_X_FORWARDED_HOST bdtd.ibict.br
HTTP_X_FORWARDED_SERVER bdtd.ibict.br
HTTP_CONNECTION Keep-Alive
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE <address>Apache/2.4.56 (Debian) Server at bdtd.ibict.br Port 80</address>
SERVER_SOFTWARE Apache/2.4.56 (Debian)
SERVER_NAME bdtd.ibict.br
SERVER_ADDR 172.16.16.179
SERVER_PORT 80
REMOTE_ADDR 172.16.16.5
DOCUMENT_ROOT /var/www/html
REQUEST_SCHEME http
CONTEXT_PREFIX /vufind
CONTEXT_DOCUMENT_ROOT /usr/local/bdtd-vufind/public
SERVER_ADMIN webmaster@localhost
SCRIPT_FILENAME /usr/local/bdtd-vufind/public/index.php
REMOTE_PORT 55600
REDIRECT_URL /vufind/Record/UFV_37025e0639c489933043de8f898ed3c8
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /vufind/Record/UFV_37025e0639c489933043de8f898ed3c8
SCRIPT_NAME /vufind/index.php
PHP_SELF /vufind/index.php
REQUEST_TIME_FLOAT 1710842867.121
REQUEST_TIME 1710842867
empty
0. Whoops\Handler\PrettyPageHandler