Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin throws an error on logout when used with PHP 8.1 #28

Open
felixhelix opened this issue Feb 1, 2023 · 2 comments
Open

Plugin throws an error on logout when used with PHP 8.1 #28

felixhelix opened this issue Feb 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@felixhelix
Copy link

felixhelix commented Feb 1, 2023

Describe the bug
When the plugins is active and a user logs out a blank page is shown and an error message logged.

To Reproduce
Steps to reproduce the behavior:

  1. Logout
  2. See blank page

What application are you using?
OPS version 3.3.0.8, PHP 8.1.14, Plugin Version

Additional information

Error message

[php:error] [pid 8516] [client 134.95.147.149:32884] PHP Fatal error: Uncaught TypeError: array_shift(): Argument #1 ($array) must be of type array, Journal given in /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php:485

Stack trace:
#0 /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php(485): array_shift()
#1 /var/www/html/lib/pkp/classes/core/PKPPageRouter.inc.php(260): PKPRouter->_urlGetBaseAndContext()
#2 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(167): PKPPageRouter->url()
#3 /var/www/html/lib/pkp/classes/core/PKPRequest.inc.php(659): Dispatcher->url()
#4 /var/www/html/plugins/generic/openid/handler/OpenIDLoginHandler.inc.php(182): PKPRequest->redirect()
#5 /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php(395): OpenIDLoginHandler->signOut()
#6 /var/www/html/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()
#7 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()
#8 /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()
#9 /var/www/html/index.php(67): PKPApplication->execute()
#10 {main}\n  thrown in /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php on line 485, referer: ...
@felixhelix felixhelix added the bug Something isn't working label Feb 1, 2023
@LalitoAlva
Copy link

Does anyone has an answer to this??

@felixhelix
Copy link
Author

I figured out that the redirect request in line 182 in openid/handler/OpenIDLoginHandler.inc.php needs to be changed to
$request->redirect(Application::get()->getRequest()->getRequestedContextPath(), 'index');
to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants