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

[OMP] Fatal error when creating a series menu item without content #10511

Open
jonasraoni opened this issue Oct 8, 2024 · 0 comments
Open

[OMP] Fatal error when creating a series menu item without content #10511

jonasraoni opened this issue Oct 8, 2024 · 0 comments
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Milestone

Comments

@jonasraoni
Copy link
Contributor

Describe the bug
After creating a series menu item without linking it to any item (see image below), a fatal error happens.

image

PHP Fatal error:  Uncaught TypeError: PKP\section\Repository::get(): Argument #1 ($id) must be of type int, string given, called in classes/services/NavigationMenuService.php on line 157 and defined in lib/pkp/classes/section/Repository.php:58
Stack trace:
#0 classes/services/NavigationMenuService.php(157): PKP\section\Repository->get()
#1 [internal function]: APP\services\NavigationMenuService->getDisplayStatusCallback()
#2 lib/pkp/classes/plugins/Hook.php(139): call_user_func_array()
#3 lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run()
#4 lib/pkp/classes/services/PKPNavigationMenuService.php(382): PKP\plugins\Hook::call()

The strange thing that needs to be analyzed is that a call to $navigationMenuItem->getPath() outputs Laravel code �*�escapeWhenCastingToString.

A workaround must be left for bad cases, and the field should be probably turned into required. If the ID is a physical field, it can be setup as not null, but a further script should clear invalid data on the upgrade.

It's also needed to check if the bug applies to OMP 3.3

To Reproduce

  1. Create a series menu item, like in the sample image
  2. Add it to the navigation
  3. See the error

What application are you using?
OMP 3.4

@jonasraoni jonasraoni added the Bug:1:Low A bug that does not have a severe consequence or affects a small number of users. label Oct 8, 2024
@jonasraoni jonasraoni added this to the 3.4.0-x milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Projects
None yet
Development

No branches or pull requests

1 participant