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

(OJS-3.4rc3) On click Add and edit templates (email) HTTP ERROR 500 appeared. #8975

Closed
shantanu198713 opened this issue May 10, 2023 · 9 comments · Fixed by #8983
Closed
Assignees

Comments

@shantanu198713
Copy link

OJS-3.4rc3
PHP-8.1.13

I want to edit or view the email template, but after clicking on 'Add & Edit Template' HTTP ERROR 500 appeared.

email error
500 error

Error log

`[10-May-2023 07:01:08 UTC] Exception: Plugin referral expected to inherit from ReferralPlugin, actual type NULL in F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php:202
Stack trace:
#0 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(218): PKP\plugins\PluginRegistry::_instantiatePlugin('generic', 'referral', 'ReferralPlugin')
#1 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(111): PKP\plugins\PluginRegistry::_loadFromDatabase('generic', NULL)
#2 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory('generic', true)
#3 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPApplication.php(372): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#4 F:\wamp64\www\ojs34rc3\index.php(21): PKP\core\PKPApplication->execute()
#5 {main}

[10-May-2023 07:01:08 UTC] Exception: Plugin coins expected to inherit from CoinsPlugin, actual type NULL in F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php:202
Stack trace:
#0 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(218): PKP\plugins\PluginRegistry::_instantiatePlugin('generic', 'coins', 'CoinsPlugin')
#1 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(111): PKP\plugins\PluginRegistry::_loadFromDatabase('generic', NULL)
#2 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory('generic', true)
#3 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPApplication.php(372): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#4 F:\wamp64\www\ojs34rc3\index.php(21): PKP\core\PKPApplication->execute()
#5 {main}

[10-May-2023 07:01:08 UTC] Exception: Plugin crossrefReferenceLinking expected to inherit from CrossrefReferenceLinkingPlugin, actual type NULL in F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php:202
Stack trace:
#0 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(218): PKP\plugins\PluginRegistry::_instantiatePlugin('generic', 'crossrefReferen...', 'CrossrefReferen...')
#1 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(111): PKP\plugins\PluginRegistry::_loadFromDatabase('generic', NULL)
#2 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory('generic', true)
#3 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPApplication.php(372): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#4 F:\wamp64\www\ojs34rc3\index.php(21): PKP\core\PKPApplication->execute()
#5 {main}

[10-May-2023 07:01:08 UTC] Exception: Plugin citations expected to inherit from CitationsPlugin, actual type NULL in F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php:202
Stack trace:
#0 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(218): PKP\plugins\PluginRegistry::_instantiatePlugin('generic', 'citations', 'CitationsPlugin')
#1 F:\wamp64\www\ojs34rc3\lib\pkp\classes\plugins\PluginRegistry.php(111): PKP\plugins\PluginRegistry::_loadFromDatabase('generic', NULL)
#2 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory('generic', true)
#3 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPApplication.php(372): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#4 F:\wamp64\www\ojs34rc3\index.php(21): PKP\core\PKPApplication->execute()
#5 {main}

[10-May-2023 07:01:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined method ReflectionUnionType::getName() in F:\wamp64\www\ojs34rc3\lib\pkp\classes\mail\Mailable.php:452
Stack trace:
#0 F:\wamp64\www\ojs34rc3\plugins\generic\orcidProfile\mailables\OrcidRequestAuthorAuthorization.php(47): PKP\mail\Mailable::getDataDescriptions()
#1 F:\wamp64\www\ojs34rc3\lib\pkp\classes\mail\Repository.php(85): APP\plugins\generic\orcidProfile\mailables\OrcidRequestAuthorAuthorization::getDataDescriptions()
#2 F:\wamp64\www\ojs34rc3\lib\pkp\pages\management\ManagementHandler.php(509): PKP\mail\Repository->summarizeMailable('APP\plugins\gen...')
#3 [internal function]: PKP\pages\management\ManagementHandler->PKP\pages\management{closure}('APP\plugins\gen...', 59)
#4 F:\wamp64\www\ojs34rc3\lib\pkp\lib\vendor\laravel\framework\src\Illuminate\Collections\Arr.php(560): array_map(Object(Closure), Array, Array)
#5 F:\wamp64\www\ojs34rc3\lib\pkp\lib\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(768): Illuminate\Support\Arr::map(Array, Object(Closure))
#6 F:\wamp64\www\ojs34rc3\lib\pkp\pages\management\ManagementHandler.php(509): Illuminate\Support\Collection->map(Object(Closure))
#7 F:\wamp64\www\ojs34rc3\lib\pkp\pages\management\ManagementHandler.php(95): PKP\pages\management\ManagementHandler->manageEmails(Array, Object(APP\core\Request))
#8 [internal function]: PKP\pages\management\ManagementHandler->settings(Array, Object(APP\core\Request))
#9 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPRouter.php(333): call_user_func(Array, Array, Object(APP\core\Request))
#10 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPPageRouter.php(278): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array, false)
#11 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\Dispatcher.php(165): PKP\core\PKPPageRouter->route(Object(APP\core\Request))
#12 F:\wamp64\www\ojs34rc3\lib\pkp\classes\core\PKPApplication.php(372): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#13 F:\wamp64\www\ojs34rc3\index.php(21): PKP\core\PKPApplication->execute()
#14 {main}
thrown in F:\wamp64\www\ojs34rc3\lib\pkp\classes\mail\Mailable.php on line 452`

@shantanu198713 shantanu198713 changed the title On click Add and edit templates (email) HTTP ERROR 500 appeared. (OJS-3.4rc3) On click Add and edit templates (email) HTTP ERROR 500 appeared. May 10, 2023
@jonasraoni
Copy link
Contributor

Hi @shantanu198713,

Looks like you're using plugins which haven't been prepared to work under OJS 3.4 (or a newer PHP version). You'll have to disable them until updates are released (if you're unable to disable them, you can move them physically from the plugins folder).

Here you can see the list of what's on our radar/what has been updated already:
#8338

In case you got other external plugins (not maintained by us), you'll have to get in touch with the plugin creator.

@jonasraoni
Copy link
Contributor

I searched fast and perhaps some plugins are from OJS 2 and probably don't even exist anymore (e.g. Referral Plugin).

@jonasraoni
Copy link
Contributor

But those are just warnings, the real error needs to be handled by us:

PHP Fatal error: Uncaught Error: Call to undefined method ReflectionUnionType::getName() in F:\wamp64\www\ojs34rc3\lib\pkp\classes\mail\Mailable.php:452

@shantanu198713
Copy link
Author

Hi @jonasraoni

Thank you for your response.
I've got the plugin (ORCID Profile Plugin), And after disabling that now the email templates are accessible.
I hope ORCID Profile Plugin will soon be compatible with PHP-8.0 and above.

@jonasraoni
Copy link
Contributor

I think this plugin is already compatible, the problem is on the code to handle email templates at OJS.

This error is tough to find, it's probably just affecting the Orcid plugin :)

@shantanu198713
Copy link
Author

shantanu198713 commented May 10, 2023

Can you provide me updated ORCID plugin for installation and testing?
Currently, I am using the ORCID Profile version [1.3.4.3].

@jonasraoni
Copy link
Contributor

jonasraoni commented May 10, 2023

This is supposed to work with 3.4 (but you just found an unexpected bug related to editing the email templates), see: https://github.com/pkp/orcidProfile/releases/tag/v1_3_4-3

@jonasraoni jonasraoni self-assigned this May 10, 2023
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue May 10, 2023
jonasraoni added a commit to jonasraoni/ojs that referenced this issue May 10, 2023
@jonasraoni
Copy link
Contributor

@Vitaliy-1
Copy link
Collaborator

Thanks, @jonasraoni! It's a tricky issue, I left a comment on how we can bypass limitation with union types. Unfortunately, Mailables weren't designed to be constructed with ambiguity in type declarations.

jonasraoni added a commit to jonasraoni/ojs that referenced this issue May 18, 2023
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue May 18, 2023
jonasraoni added a commit to jonasraoni/ojs that referenced this issue May 18, 2023
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue May 24, 2023
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue May 24, 2023
jonasraoni added a commit to jonasraoni/ojs that referenced this issue May 24, 2023
jonasraoni added a commit that referenced this issue May 25, 2023
…e-editor

#8975 Fixed argument reflection handling
@jonasraoni jonasraoni linked a pull request May 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants