OJS3 "Continue without saving" modal won't cancel

ojs3

#1

Editing any form in the admin interface (for example, Website Settings->Appearance and selecting a different font under Typography), then navigating away from that page (by clicking another link) brings up a modal dialog “The data on this form has changed. Do wish to continue without saving?” Choosing Cancel does not dismiss the dialog, the only valid choice is to click “OK”, leaving the page and losing your work.

Is this a configuration issue on our end? Or a bug?


#2

Hi @relaxing

Can you specify the OJS version that you are using, e.g. OJS 3.1.1-4 or OJS 3.1.1-2? Also, are you using the default theme?


#3

Hi @Vitaliy, we are running the default theme. OJS 3.1.1-4.


#4

Hmm. I cannot reproduce it on this version. Can you look at the PHP error log and browser’s console for errors? Relevant are logs just after reproducing the error.
If you are using hosting, you can ask hosting provider for PHP logs. On Ubuntu they are located inside /var/log/apache2/ directory by default (file called error.log)


#5

@Vitaliy Here are the errors generated loading the page edited. No errors are thrown when the modal pops up.

[Tue Jan 08 17:00:31.073855 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.078108 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/html/journal/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 24, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.081727 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.100213 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of ContextSettingsForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.100277 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of ContextSettingsForm::initData($request) should be compatible with Form::initData() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.100288 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of ContextSettingsForm::readInputData($request) should be compatible with Form::readInputData() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.100297 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of ContextSettingsForm::execute($request) should be compatible with Form::execute() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.100312 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of PKPAppearanceForm::fetch($request) should be compatible with ContextSettingsForm::fetch($request, $params = NULL) in /var/www/html/journal/lib/pkp/controllers/tab/settings/appearance/form/PKPAppearanceForm.inc.php on line 18, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.305110 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.308921 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/html/journal/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 24, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.312798 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.393594 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.397651 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/html/journal/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 24, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.400932 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 17:00:31.406396 2019] [php7:warn] [pid 4350] [client 0.72.75.162:63770] PHP Warning: Declaration of BlockPluginsListbuilderHandler::initialize($request) should be compatible with MultipleListsListbuilderHandler::initialize($request, $args = NULL) in /var/www/html/journal/lib/pkp/controllers/listbuilder/settings/BlockPluginsListbuilderHandler.inc.php on line 17, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website


#6

And these are the errors generated after clicking ok and landing on the new page. No errors are generated when cancel is clicked.

[Tue Jan 08 18:06:15.687477 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.691843 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/html/journal/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 24, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.695648 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.713193 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of ContextSettingsForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.713257 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of ContextSettingsForm::initData($request) should be compatible with Form::initData() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.713269 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of ContextSettingsForm::readInputData($request) should be compatible with Form::readInputData() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.713278 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of ContextSettingsForm::execute($request) should be compatible with Form::execute() in /var/www/html/journal/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.892308 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.896899 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/html/journal/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 24, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website
[Tue Jan 08 18:06:15.902770 2019] [php7:warn] [pid 4350] [client 0.72.75.162:64023] PHP Warning: Cannot use a scalar value as an array in /var/www/html/journal/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://0.230.130.126/journal/index.php/perceptions/management/settings/website


#7

Yeah, no relevant errors. And I can reproduce this behavior. There is an issue on GitHub and it’s resolved, so needed changes will be shipped in one of the future releases: https://github.com/pkp/pkp-lib/issues/4157


#8

Thank you for reproducing, @Vitaliy. On the surface, issue #4157 that you linked looks like a different bug, because my issue does not involve reloading the page with a modal open. Can you confirm, @asmecher? I would be happy to open a new issue in GH if so.


#9

Hi @relaxing and @Vitaliy,

I agree that it doesn’t look at a glance like the same issue. @relaxing, it looks like you’ve included your PHP error log above, but have you checked your browser’s error console? This could be caused e.g. by a Javascript error.

Regards,
Alec Smecher
Public Knowledge Project Team


#10

Hi @asmecher,

No errors in the console, running Chrome 71. Turning up the log level to verbose reveals some warnings from jquery and tinymce libs.

jquery.js:9627 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.
[Violation] Added non-passive event listener to a scroll-blocking ‘touchstart’ event. Consider marking event handler as ‘passive’ to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
jquery-ui.js:15678 [Violation] ‘setTimeout’ handler took 162ms
tinymce.js:11548 [Violation] ‘load’ handler took 247ms
[Violation] Forced reflow while executing JavaScript took 64ms
jquery.js:4288 [Violation] ‘focus’ handler took 1609ms
jquery-ui.js:15678 [Violation] Forced reflow while executing JavaScript took 64ms

Each time I click Cancel on the modal it spawns a warning:

jquery.js:4288 [Violation] ‘focus’ handler took 1609ms

Nothing new happens on clicking OK.


#11

Hi @relaxing,

I’m seeing similar behavior over here – I’ve filed it at https://github.com/pkp/pkp-lib/issues/4352. Watch that entry for an update.

Regards,
Alec Smecher
Public Knowledge Project Team