Exception
Cannot determine URL to share. Exception thrown with message "Cannot determine URL to share." Stacktrace: #9 Exception in /usr/local/vufind/module/VuFind/src/VuFind/Controller/SearchController.php:156 #8 VuFind\Controller\SearchController:emailAction in /usr/local/vufind/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php:72 #7 Laminas\Mvc\Controller\AbstractActionController:onDispatch in /usr/local/vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:320 #6 Laminas\EventManager\EventManager:triggerListeners in /usr/local/vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:178 #5 Laminas\EventManager\EventManager:triggerEventUntil in /usr/local/vufind/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php:105 #4 Laminas\Mvc\Controller\AbstractController:dispatch in /usr/local/vufind/vendor/laminas/laminas-mvc/src/DispatchListener.php:117 #3 Laminas\Mvc\DispatchListener:onDispatch in /usr/local/vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:320 #2 Laminas\EventManager\EventManager:triggerListeners in /usr/local/vufind/vendor/laminas/laminas-eventmanager/src/EventManager.php:178 #1 Laminas\EventManager\EventManager:triggerEventUntil in /usr/local/vufind/vendor/laminas/laminas-mvc/src/Application.php:319 #0 Laminas\Mvc\Application:run in /usr/local/vufind/public/index.php:23
9
Exception
/module/VuFind/src/VuFind/Controller/SearchController.php156
8
VuFind\Controller\SearchController emailAction
/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php72
7
Laminas\Mvc\Controller\AbstractActionController onDispatch
/vendor/laminas/laminas-eventmanager/src/EventManager.php320
6
Laminas\EventManager\EventManager triggerListeners
/vendor/laminas/laminas-eventmanager/src/EventManager.php178
5
Laminas\EventManager\EventManager triggerEventUntil
/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php105
4
Laminas\Mvc\Controller\AbstractController dispatch
/vendor/laminas/laminas-mvc/src/DispatchListener.php117
3
Laminas\Mvc\DispatchListener onDispatch
/vendor/laminas/laminas-eventmanager/src/EventManager.php320
2
Laminas\EventManager\EventManager triggerListeners
/vendor/laminas/laminas-eventmanager/src/EventManager.php178
1
Laminas\EventManager\EventManager triggerEventUntil
/vendor/laminas/laminas-mvc/src/Application.php319
0
Laminas\Mvc\Application run
/public/index.php23
 
        // Force login if necessary:
        $config = $this->getConfig();
        if (
            (!isset($config->Mail->require_login) || $config->Mail->require_login)
            && !$this->getUser()
        ) {
            return $this->forceLogin(null, ['emailurl' => $view->url]);
        }
 
        // Check if we have a URL in login followup data -- this should override
        // any existing referer to avoid emailing a login-related URL!
        $followupUrl = $this->followup()->retrieveAndClear('emailurl');
        if (!empty($followupUrl)) {
            $view->url = $followupUrl;
        }
 
        // Fail if we can't figure out a URL to share:
        if (empty($view->url)) {
            throw new \Exception('Cannot determine URL to share.');
        }
 
        // Process form submission:
        if ($this->formWasSubmitted('submit', $view->useCaptcha)) {
            // Attempt to send the email and show an appropriate flash message:
            try {
                // If we got this far, we're ready to send the email:
                $cc = $this->params()->fromPost('ccself') && $view->from != $view->to
                    ? $view->from : null;
                $mailer->sendLink(
                    $view->to,
                    $view->from,
                    $view->message,
                    $view->url,
                    $this->getViewRenderer(),
                    $view->subject,
                    $cc
                );
                $this->flashMessenger()->addMessage('email_success', 'success');
                return $this->redirect()->toUrl($view->url);
     */
    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 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) ? $eventName::class : 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(static fn($test): bool => $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->request;
            );
            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($controller::class);
            $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) ? $eventName::class : 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
$vufindProfiler = getenv('VUFIND_PROFILER_XHPROF');
if (!empty($vufindProfiler)) {
    include __DIR__ . '/../module/VuFind/functions/profiler.php';
    enableVuFindProfiling($vufindProfiler);
}
 
// Run the application!
$app = include __DIR__ . '/../config/application.php';
if (PHP_SAPI === 'cli') {
    return $app->getServiceManager()
        ->get(\VuFindConsole\ConsoleRunner::class)->run();
} else {
    // Setup remote code coverage if enabled:
    if (getenv('VUFIND_CODE_COVERAGE')) {
        $modules = $app->getServiceManager()
            ->get(\Laminas\ModuleManager\ModuleManager::class)->getModules();
        include __DIR__ . '/../module/VuFind/functions/codecoverage.php';
        setupVuFindRemoteCodeCoverage($modules);
    }
    $app->run();
}
 

Environment & details:

empty
empty
empty
empty
Key Value
__Laminas Array ( [_REQUEST_ACCESS_TIME] => 1710825261.6887 [_VALID] => Array ( [Laminas\Session\Validator\Id] => pmk2vvf8a2r3475f8rqpjl88cm ) )
SessionState Laminas\Stdlib\ArrayObject Object ( [storage:protected] => Array ( [cookiePath] => / [sessionStartTime] => 1710825261 ) [flag:protected] => 2 [iteratorClass:protected] => ArrayIterator [protectedProperties:protected] => Array ( [0] => storage [1] => flag [2] => iteratorClass [3] => protectedProperties ) )
Key Value
USER apache
HOME /usr/share/httpd
SCRIPT_NAME /index.php
REQUEST_URI /Search/Email
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /Search/Email
REMOTE_PORT 50386
SCRIPT_FILENAME /usr/local/vufind/public/index.php
SERVER_ADMIN it-mainlib.updiliman@up.edu.ph
CONTEXT_DOCUMENT_ROOT /usr/local/vufind/public
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /usr/local/vufind/public
REMOTE_ADDR 3.85.63.190
SERVER_PORT 443
SERVER_ADDR 10.36.129.14
SERVER_NAME ds.mainlib.upd.edu.ph
SERVER_SOFTWARE Apache
SERVER_SIGNATURE
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/var/lib/snapd/snap/bin
HTTP_HOST ds.mainlib.upd.edu.ph
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
proxy-nokeepalive 1
SSL_SESSION_RESUMED Initial
SSL_SESSION_ID 0a812e2af8765e8a0bc2cf048217c2ee61ce6f753d5a9c126374a706e6965d56
SSL_SERVER_A_SIG sha256WithRSAEncryption
SSL_SERVER_A_KEY id-ecPublicKey
SSL_SERVER_I_DN CN=R3,O=Let's Encrypt,C=US
SSL_SERVER_S_DN CN=ds.mainlib.upd.edu.ph
SSL_SERVER_V_END May 13 23:17:42 2024 GMT
SSL_SERVER_V_START Feb 13 23:17:43 2024 GMT
SSL_SERVER_M_SERIAL 03DA1AA8AF4C62EA103BD0F6B37533BEEF98
SSL_SERVER_M_VERSION 3
SSL_CLIENT_VERIFY NONE
SSL_CIPHER_ALGKEYSIZE 256
SSL_CIPHER_USEKEYSIZE 256
SSL_CIPHER_EXPORT false
SSL_CIPHER TLS_AES_256_GCM_SHA384
SSL_COMPRESS_METHOD NULL
SSL_SECURE_RENEG true
SSL_PROTOCOL TLSv1.3
SSL_VERSION_LIBRARY OpenSSL/3.0.9
SSL_VERSION_INTERFACE mod_ssl/2.4.58
SSL_SERVER_SAN_DNS_0 ds.mainlib.upd.edu.ph
SSL_SERVER_I_DN_CN R3
SSL_SERVER_I_DN_O Let's Encrypt
SSL_SERVER_I_DN_C US
SSL_SERVER_S_DN_CN ds.mainlib.upd.edu.ph
SSL_TLS_SNI ds.mainlib.upd.edu.ph
HTTPS on
VUFIND_LOCAL_DIR /usr/local/vufind/local
VUFIND_ENV development
UNIQUE_ID ZfkfLTXdB7NaOsVqs_Y3wQAAA8E
REDIRECT_STATUS 200
REDIRECT_SSL_TLS_SNI ds.mainlib.upd.edu.ph
REDIRECT_HTTPS on
REDIRECT_VUFIND_LOCAL_DIR /usr/local/vufind/local
REDIRECT_VUFIND_ENV development
REDIRECT_UNIQUE_ID ZfkfLTXdB7NaOsVqs_Y3wQAAA8E
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710825261.6593
REQUEST_TIME 1710825261
empty
0. Whoops\Handler\PrettyPageHandler