Two problems with OJS 3.1.1

I recently upgraded to OJS 3.1.1.
I am getting following errors on JS console when I try to access submissions page on admin panel .

jquery.js:9666 GET http://localhost:8080/tjapril1/index.php/technical-journal/api/v1/_submissions?status=1&assignedTo=-1&searchPhrase=&count=20&offset=0&_=1523026587408 500 (Internal Server Error)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:214 Uncaught TypeError: Cannot read property 'trigger' of undefined
    at proxyConstructor.$.pkp.controllers.modal.ModalHandler.modalOpen (ModalHandler.js:214)
    at $e.ajaxErrorCallback (build.js:6)
    at Object.error (build.js:1)
    at fire (jquery.js:3099)
    at Object.fireWith [as rejectWith] (jquery.js:3211)
    at done (jquery.js:9312)
    at XMLHttpRequest.callback (jquery.js:9720)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:214
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:204 Uncaught TypeError: Cannot read property 'addClass' of undefined
    at ModalHandler.js:204
(anonymous) @ ModalHandler.js:204
setTimeout (async)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:203
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:210 Uncaught TypeError: Cannot read property 'focus' of undefined
    at ModalHandler.js:210
(anonymous) @ ModalHandler.js:210
setTimeout (async)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:209
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
jquery.js:9666 GET http://localhost:8080/tjapril1/index.php/technical-journal/api/v1/_submissions?status=1&searchPhrase=&count=20&offset=0&_=1523026587409 500 (Internal Server Error)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:214 Uncaught TypeError: Cannot read property 'trigger' of undefined
    at proxyConstructor.$.pkp.controllers.modal.ModalHandler.modalOpen (ModalHandler.js:214)
    at $e.ajaxErrorCallback (build.js:6)
    at Object.error (build.js:1)
    at fire (jquery.js:3099)
    at Object.fireWith [as rejectWith] (jquery.js:3211)
    at done (jquery.js:9312)
    at XMLHttpRequest.callback (jquery.js:9720)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:214
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:204 Uncaught TypeError: Cannot read property 'addClass' of undefined
    at ModalHandler.js:204
(anonymous) @ ModalHandler.js:204
setTimeout (async)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:203
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
jquery.js:9666 GET http://localhost:8080/tjapril1/index.php/technical-journal/api/v1/_submissions?status%5B%5D=4&status%5B%5D=3&searchPhrase=&count=20&offset=0&_=1523026587410 500 (Internal Server Error)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:214 Uncaught TypeError: Cannot read property 'trigger' of undefined
    at proxyConstructor.$.pkp.controllers.modal.ModalHandler.modalOpen (ModalHandler.js:214)
    at $e.ajaxErrorCallback (build.js:6)
    at Object.error (build.js:1)
    at fire (jquery.js:3099)
    at Object.fireWith [as rejectWith] (jquery.js:3211)
    at done (jquery.js:9312)
    at XMLHttpRequest.callback (jquery.js:9720)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:214
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
ModalHandler.js:204 Uncaught TypeError: Cannot read property 'addClass' of undefined
    at ModalHandler.js:204
(anonymous) @ ModalHandler.js:204
setTimeout (async)
$.pkp.controllers.modal.ModalHandler.modalOpen @ ModalHandler.js:203
ajaxErrorCallback @ build.js:6
error @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9312
callback @ jquery.js:9720
XMLHttpRequest.send (async)
send @ jquery.js:9666
ajax @ jquery.js:9211
get @ build.js:1
(anonymous) @ build.js:1
fire @ jquery.js:3099
fireWith @ jquery.js:3211
ready @ jquery.js:3423
completed @ jquery.js:3453
2ModalHandler.js:210 Uncaught TypeError: Cannot read property 'focus' of undefined

1. When I try to access the URL that returns 500 error I get
Slim Application Error
A website error has occurred. Sorry for the temporary inconvenience.

2. however when I remove index.php/journal name/ from path I get
Fatal Error: [06-Apr-2018 15:02:57 UTC] PHP Fatal error: Uncaught Error: Call to undefined function import() in C:\wamp64\www\tjapril1\api\v1\_submissions\index.php:19

How can I solve these?

My base URL is
base_url = “http://localhost:8080/tjapril1/” I also tried base_url = “http://localhost:8080/tjapril1/index.php/technical-journal/”

and restful_urls = Off

Fixed using settings suggested here

But will it affect functionality considering my DB using latin1 coalition and not utf8?

Hi @Taz,

MySQL will happily store UTF-8 data in a table that thinks it’s Latin1, if that’s what you tell it to do. In that case, some kinds of features won’t work properly – string lengths will appear different than expected, text conversions like upper/lower case may get things wrong, etc.

Regards,
Alec Smecher
Public Knowledge Project Team

Any solution to avoid these problems?

Hi @Taz,

Yes, I would suggest transcoding your database to a proper UTF-8 configuration using something like iconv or ftfy. You might find some useful information on StackOverflow.com.

At the moment your data encoding is wrong, but consistently wrong; beware of accidentally mixing correct and incorrect encodings together, as that gets really difficult to untangle (though ftfy can help).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,
Thanks.

Converted using this guide.

https://docs.moodle.org/23/en/Converting_your_MySQL_database_to_UTF8#Windows

1 Like