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

Cannot Create Section when browseBySection Plugin is Active #37

Closed
kswro opened this issue Dec 21, 2023 · 2 comments
Closed

Cannot Create Section when browseBySection Plugin is Active #37

kswro opened this issue Dec 21, 2023 · 2 comments
Assignees
Milestone

Comments

@kswro
Copy link

kswro commented Dec 21, 2023

Describe the bug
If the browseBySection plugin is activated, it will not be possible to add sections. When pressing the "Create Section" button in the Journal Settings --> Section menu, an error message appears: "Failed Ajax request or invalid JSON returned."

To Reproduce
Steps to reproduce the behavior:

  1. Fresh Install
  2. Download and activate the browseBySection plugin
  3. Access Journal Section page (Journal Settings --> Section)
  4. Click "Create Section"
  5. Error

What application are you using?

  1. OJS 3.4.0.4
  2. browseBySection 1.2.1.0
  3. PHP 8.2.11

Log

PHP Fatal error:  Uncaught TypeError: PKP\section\Repository::get(): Argument #1 ($id) must be of type int, null given, called in /home/.../public_html/plugins/generic/browseBySection/BrowseBySectionPlugin.php on line 159 and defined in /home/.../public_html/lib/pkp/classes/section/Repository.php:58
Stack trace:
#0 /home/.../public_html/plugins/generic/browseBySection/BrowseBySectionPlugin.php(159): PKP\section\Repository->get()
#1 [internal function]: APP\plugins\generic\browseBySection\BrowseBySectionPlugin->initDataSectionFormFields()
#2 /home/.../public_html/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array()
#3 /home/.../public_html/lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run()
#4 /home/.../public_html/lib/pkp/classes/form/Form.php(266): PKP\plugins\Hook::call()
#5 /home/.../public_html/lib/pkp/controllers/grid/settings/sections/form/PKPSectionForm.php(170): PKP\form\Form->initData()
#6 /home/.../public_html/controllers/grid/settings/sections/form/SectionForm.php(81): PKP\controllers\grid\settings\sections\form\PKPSectionForm->initData()
#7 /home/.../public_html/controllers/grid/settings/sections/SectionGridHandler.php(214): APP\controllers\grid\settings\sections\form\SectionForm->initData()
#8 /home/.../public_html/controllers/grid/settings/sections/SectionGridHandler.php(196): APP\controllers\grid\settings\sections\SectionGridHandler->editSection()
#9 [internal function]: APP\controllers\grid\settings\sections\SectionGridHandler->addSection()
#10 /home/.../public_html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#11 /home/.../public_html/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#12 /home/.../public_html/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route()
#13 /home/.../public_html/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch()
#14 /home/.../public_html/index.php(21): PKP\core\PKPApplication->execute()
#15 {main}
  thrown in /home/.../public_html/lib/pkp/classes/section/Repository.php on line 58
@bokamm
Copy link

bokamm commented May 7, 2024

Hallo!

I have the same problem with the plugin (and cannot "save" changes to existing sections; see this closed issue: #29).

I am using

  1. OJS 3.4.0.5
  2. browseBySection 1.2.1.0
  3. PHP 8.2.6

Logs

CHANGE EXISTING SECTION
<br/>
<b>Fatal error</b>
:  Uncaught Error: Non-static method PKP\i18n\Locale::getPrimaryLocale() cannot be called statically in /var/www/xxx/plugins/generic/browseBySection/BrowseBySectionPlugin.php:217
Stack trace:
#0 [internal function]: APP\plugins\generic\browseBySection\BrowseBySectionPlugin-&gt;executeSectionFormFields('sectionform::ex...', Array)
#1 /var/www/xxx/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array(Array, Array)
#2 /var/www/xxx/lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run('sectionform::ex...', Array)
#3 /var/www/xxx/lib/pkp/classes/form/Form.php(350): PKP\plugins\Hook::call('sectionform::ex...', Array)
#4 /var/www/xxx/lib/pkp/controllers/grid/settings/sections/form/PKPSectionForm.php(199): PKP\form\Form-&gt;execute(Array)
#5 /var/www/xxx/controllers/grid/settings/sections/form/SectionForm.php(196): PKP\controllers\grid\settings\sections\form\PKPSectionForm-&gt;execute()
#6 /var/www/xxx/controllers/grid/settings/sections/SectionGridHandler.php(234): APP\controllers\grid\settings\sections\form\SectionForm-&gt;execute()
#7 [internal function]: APP\controllers\grid\settings\sections\SectionGridHandler-&gt;updateSection(Array, Object(APP\core\Request))
#8 /var/www/xxx/lib/pkp/classes/core/PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request))
#9 /var/www/xxx/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter-&gt;_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array)
#10 /var/www/xxx/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter-&gt;route(Object(APP\core\Request))
#11 /var/www/xxx/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher-&gt;dispatch(Object(APP\core\Request))
#12 /var/www/xxx/index.php(21): PKP\core\PKPApplication-&gt;execute()
#13 {main}
  thrown in <b>/var/www/xxx/plugins/generic/browseBySection/BrowseBySectionPlugin.php</b>
on line <b>217</b>
<br/>

CREATE NEW SECTION
<br/>
<b>Fatal error</b>
:  Uncaught TypeError: PKP\section\Repository::get(): Argument #1 ($id) must be of type int, null given, called in /var/www/xxx/plugins/generic/browseBySection/BrowseBySectionPlugin.php on line 159 and defined in /var/www/xxx/lib/pkp/classes/section/Repository.php:58
Stack trace:
#0 /var/www/xxx/plugins/generic/browseBySection/BrowseBySectionPlugin.php(159): PKP\section\Repository-&gt;get(NULL, 1)
#1 [internal function]: APP\plugins\generic\browseBySection\BrowseBySectionPlugin-&gt;initDataSectionFormFields('sectionform::in...', Array)
#2 /var/www/xxx/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array(Array, Array)
#3 /var/www/xxx/lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run('sectionform::in...', Array)
#4 /var/www/xxx/lib/pkp/classes/form/Form.php(266): PKP\plugins\Hook::call('sectionform::in...', Array)
#5 /var/www/xxx/lib/pkp/controllers/grid/settings/sections/form/PKPSectionForm.php(170): PKP\form\Form-&gt;initData()
#6 /var/www/xxx/controllers/grid/settings/sections/form/SectionForm.php(81): PKP\controllers\grid\settings\sections\form\PKPSectionForm-&gt;initData()
#7 /var/www/xxx/controllers/grid/settings/sections/SectionGridHandler.php(214): APP\controllers\grid\settings\sections\form\SectionForm-&gt;initData()
#8 /var/www/xxx/controllers/grid/settings/sections/SectionGridHandler.php(196): APP\controllers\grid\settings\sections\SectionGridHandler-&gt;editSection(Array, Object(APP\core\Request))
#9 [internal function]: APP\controllers\grid\settings\sections\SectionGridHandler-&gt;addSection(Array, Object(APP\core\Request))
#10 /var/www/xxx/lib/pkp/classes/core/PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request))
#11 /var/www/xxx/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter-&gt;_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array)
#12 /var/www/xxx/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter-&gt;route(Object(APP\core\Request))
#13 /var/www/xxx/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher-&gt;dispatch(Object(APP\core\Request))
#14 /var/www/xxx/index.php(21): PKP\core\PKPApplication-&gt;execute()
#15 {main}
  thrown in <b>/var/www/xxx/lib/pkp/classes/section/Repository.php</b>
on line <b>58</b>
<br/>

Console Screenshots
section1
section2

kaitlinnewson added a commit to kaitlinnewson/browseBySection that referenced this issue Dec 3, 2024
kaitlinnewson added a commit that referenced this issue Dec 4, 2024
#37 fix errors with creating and deleting sections…
kaitlinnewson added a commit to kaitlinnewson/browseBySection that referenced this issue Dec 4, 2024
kaitlinnewson added a commit that referenced this issue Dec 4, 2024
#37 fix errors with creating and deleting sections…
kaitlinnewson added a commit to kaitlinnewson/browseBySection that referenced this issue Dec 4, 2024
kaitlinnewson added a commit that referenced this issue Dec 4, 2024
#37 fix errors with creating and deleting sections…
@kaitlinnewson
Copy link
Member

Fixed and released for 3.3/3.4, closing.

@kaitlinnewson kaitlinnewson self-assigned this Dec 5, 2024
@kaitlinnewson kaitlinnewson added this to the 1.2.0.1 milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants