[OJS 3.2.0.3] Failed Ajax request or invalid JSON returned in Workflow Settings

Hello,

After a fresh install with no errors, if I try to access under Settings → Workflow → Submission tab ->Components or Checklist settings, if I press the Edit button of any of the available settings I get Failed Ajax request or invalid JSON.

I’m sure that is related with the server. I have the same version running in my computer with Xampp and is working as expected. Checking the settings of both installations they have the same configuration.

Server is running PHP 7.3 but I have no access to the php log…

I changed folder permissions, I reinstalled it two times but with no results.

Seems to be the only menu that is not working correctly.

Any clue?

Thanks!

Hi @Enrique,

You should always have access to the PHP error log (and debugging without will be very difficult) – are you sure you can’t access it?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for your reply!

From my post I was investigating and I found the PHP error log (it was hidden), but is empty. Seems not writing anything into it when this error occurs.

Thanks for your support.

Regards,
Enrique

Hi @Enrique,

I would expect to find something there – even if just warnings. But in any case, you could also use the web browser’s developer tools to inspect the response that OJS is sending to your browser that is causing problems. It should be valid JSON but you may find a PHP warning or invalid UTF-8 character in there.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is what I get inspecting with developer tools when I click to Edit button of Article Text section under Submission → Components (it happens with all Edit buttons):

<br />
<b>Warning</b>:  Declaration of GenreForm::initData($args) should be compatible with Form::initData() in <b>/var/www/vhost/estudiosbandisticos.com/home/html/journal/lib/pkp/controllers/grid/settings/genre/form/GenreForm.inc.php</b> on line <b>18</b><br />
{"status":true,"content":"<script type=\"text\/javascript\">\n\t$(function() {\n\t\t\/\/ Attach the form handler.\n\t\t$('#genreForm').pkpHandler('$.pkp.controllers.form.AjaxFormHandler');\n\t});\n<\/script>\n\n<form class=\"pkp_form\" id=\"genreForm\" method=\"post\" action=\"https:\/\/www.estudiosbandisticos.com\/journal\/index.php\/estudiosbandisticos\/$$$call$$$\/grid\/settings\/genre\/genre-grid\/update-genre\">\n<input type=\"hidden\" name=\"csrfToken\" value=\"195c4353b52868232d184324284215f2\">\n<script>\n\t$(function() {\n\t\t\/\/ Attach the form handler.\n\t\t$('#genreFormNotification').pkpHandler('$.pkp.controllers.NotificationHandler',\n\t\t{\n\t\t\tfetchNotificationUrl: \"https:\\\/\\\/www.estudiosbandisticos.com\\\/journal\\\/index.php\\\/estudiosbandisticos\\\/notification\\\/fetchNotification\",\nhasSystemNotifications: null\n\t\t});\n\t});\n<\/script>\n<div id=\"genreFormNotification\" class=\"pkp_notification \"><\/div>\n\n<fieldset  id=\"genreInfo\">\n\t\t\n<div class=\"section  \">\n\t\t\t\t\t<label  for=\"name-localization-popover-container-5ecd7f8c59f4b\">Nombre<span class=\"req\">*<\/span><\/label>\t\t\t\n\t\t\t\t\n<div>\n\t<script>\n\t$(function() {\n\t\t$('#name-localization-popover-container-5ecd7f8c59f4b').pkpHandler(\n\t\t\t'$.pkp.controllers.form.MultilingualInputHandler'\n\t\t\t);\n\t});\n\t<\/script>\n\t\t<span id=\"name-localization-popover-container-5ecd7f8c59f4b\" class=\"localization_popover_container\">\n\t\t<input type=\"text\"\n\t\t\tmaxlength=\"80\" required=\"true\"validation=\"required\" \n\t\t\tclass=\"localizable  required\"\n\t\t\t\t\t\t\t\t\tvalue=\"Texto del art\u00edculo\"\n\t\t\tname=\"name[es_ES]\"\n\t\t\tid=\"name-es_ES-5ecd7f8c59f4b\"\n\t\t\t required aria-required=\"true\"\t\t\/>\n\n\t\t\n\n\t\t<div class=\"localization_popover\">\n\t\t\t\t\t\t\t<input\ttype=\"text\"\n\t\t\t\t\tmaxlength=\"80\" required=\"true\"validation=\"required\" \n\t\t\t\t\tplaceholder=\"English\"\n\t\t\t\t\tclass=\"multilingual_extra flag flag_en_US\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue=\"Article Text\"\n\t\t\t\t\tname=\"name[en_US]\"\n\t\t\t\t\tid=\"name-en_US-5ecd7f8c59f4b\"\n\t\t\t\t\t\t\t\t\t\/>\n\t\t\t\t<label for=\"name-en_US-5ecd7f8c59f4b\" class=\"locale\">(English)<\/label>\n\t\t\t\t\t<\/div>\n\t<\/span>\n<\/div>\n\n\n\t<\/div>\n\n<div class=\"section  \">\n\t\t\t<ul class=\"checkbox_and_radiobutton\">\t\t<label >Opciones<\/label>\t\t\t\n\t\t\t\t<li>\n\t\t\t<label>\n\t\t<input type=\"checkbox\" id=\"dependent\" name=\"dependent\"  class=\"field checkbox\"\/>\n\t\t\tMarcar los archivos de este tipo como archivos dependientes\n\t\t\t\t<\/label>\n\t<\/li>\n\n\t<li>\n\t\t\t<label>\n\t\t<input type=\"checkbox\" id=\"supplementary\" name=\"supplementary\"  class=\"field checkbox\"\/>\n\t\t\tMarcar los ficheros de este tipo como ficheros complementarios (p. ej.: contenido de env\u00edo no primario)\n\t\t\t\t<\/label>\n\t<\/li>\n\n\n\t<\/ul><\/div>\n\n<div class=\"section  \">\n\t\t\t\t\t<label  for=\"category\">Agrupaci\u00f3n de tipos de archivo<\/label>\t\t\t\n\t\t\t\t\n<div>\n<select id=\"category\" name=\"category\" >\n\t\t<option value=\"1\" selected=\"selected\">Documento<\/option>\n<option value=\"2\">Archivo de ilustraci\u00f3n<\/option>\n<option value=\"3\">Contenido complementario<\/option>\n<\/select>\n\n<\/div>\n\n\n\t<\/div>\n\n<div class=\"section  \">\n\t\t\t\t\t\t\t<label for=\"key-5ecd7f8c5d98c\">Contrase\u00f1a<\/label>\n\t\t\t\t<label class=\"description\">Un identificador simb\u00f3lico corto para este g\u00e9nero.<\/label>\t\t\t\t\t\t\n\t\t\t\t\n<div class=\"pkp_helpers_quarter\">\n\t\t<input\ttype=\"text\"\n\t\tmaxlength=\"30\" validation=\"\" \n\t\tclass=\"field text\"\n\t\t\t\t readonly=\"readonly\"\t\tname=\"key\"\n\t\tvalue=\"SUBMISSION\"\n\t\tid=\"key-5ecd7f8c5d98c\"\n\t\t\t\t\t\t\t\/>\n\n\t\n\t<span><\/span>\n<\/div>\n\n\n\t<\/div>\n\n<\/fieldset>\n\n\t<input type=\"hidden\" name=\"gridId\" value=\"grid-settings-genre-genregrid\" \/>\n\t<input type=\"hidden\" name=\"genreId\" value=\"1\" \/>\n<p><span class=\"formRequired\">* Campo obligatorio<\/span><\/p>\n\n<div class=\"section formButtons form_buttons \">\n\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t<button class=\"pkp_button submitFormButton\" type=\"submit\"  id=\"submitFormButton-5ecd7f8c5dd8c\" >Guardar<\/button>\n\n\n\t\t<span class=\"pkp_spinner\"><\/span>\n\n\t\t\t\t\t\t\t\t<a href=\"#\" id=\"cancelFormButton-5ecd7f8c5de79\" class=\"cancelButton\">Cancelar<\/a>\n\t\n\t<\/div>\n\n<\/form>\n","elementId":"0","events":null}

This is useful?

Kind regards,
Enrique

Hi @Enrique,

That warning is cosmetic, but because it’s being sent out to the browser, it’s interfering with the JSON response. Configure your PHP so that errors/warnings are sent to the log, not the browser. (This is recommended for PHP users in general.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Solved!

display_errors PHP setting to OFF and now it’s working as expected.

Thanks for your support!

2 Likes