Page 1 of 1

Jquery component warnings

Posted: Thu Jun 10, 2021 4:17 pm
by cpetrovay
I have been having some problems in Forma LMS (not being able to add new users). I have tried in Chrome and Firefox, and using the Developer tools, I have discovered 3 warnings related to jQuery.
Loading failed for the <script> with source “http:// serverroot /addons/jquery/core/ui/js/i18n/datepicker-en;%20en-us.js”.
Source map error: Error: request failed with status 404
Resource URL: http:// serverroot /addons/jquery/bootstrap/css/bootstrap-3.3.6.min.css
Source Map URL: bootstrap.min.css.map
Source map error: Error: request failed with status 404
Resource URL: http:// serverroot /addons/jquery/select/bootstrap-select.min.js
Source Map URL: bootstrap-select.js.map
My install is version 2.3.0 on Apache/2.4.23 (Win32); PHP/5.6.25; MySQL/5.7.14.

Any advice is appreciated.

Re: Jquery component warnings

Posted: Thu Jun 10, 2021 7:41 pm
by alfa24
Which (relative) URL is giving you the 404s?

Re: Jquery component warnings

Posted: Fri Jun 11, 2021 5:34 pm
by cpetrovay
I've noticed the problem on http:// serverroot /appCore/index.php?r=adm/usermanagement/show

Re: Jquery component warnings

Posted: Fri Jun 11, 2021 6:24 pm
by alfa24
Only the first 404 is fired on that URL.
To solve, first of all you have to copy /addons/jquery/core/ui/js/i18n/datepicker-en-GB.js to /addons/jquery/core/ui/js/i18n/datepicker-en-US.js

then you need to edit /lib/lib.jquerylib.php at the line:

$lang = DoceboLangManager::getInstance()->getLanguageBrowsercode(Lang::get());

add after it:

$lang1 = array_pop(explode(";",$lang));
$lang2 = explode("-";$lang1);
$lang = (count($lang2)==1?$lang2[0]:$lang2[0].strtoupper($lang2[1]));

Re: Jquery component warnings

Posted: Mon Jun 14, 2021 4:28 pm
by cpetrovay
My original $lang value is "en; en-us".

The new code you provided returns the following error:
GET http:// serverroot /addons/jquery/core/ui/js/i18n/datepicker-%20enUS.js net::ERR_ABORTED 404 (Not Found)
I found the following code resolved my datepicker language issue:

Code: Select all

$lang1 = array_pop(explode(";",$lang));
$lang2 = explode("-",$lang1);
$lang = trim((count($lang2)==1) ? $lang2[0] : $lang2[0]."-".strtoupper($lang2[1]));
I still get source map 404 vwarnings for bootstrap.js.map, bootstrap-theme.min.css.map, amd bootstrap.min.css.map.

Re: Jquery component warnings

Posted: Mon Jun 14, 2021 4:31 pm
by alfa24
An original 2.3 /appCore/index.php?r=adm/usermanagement/show won't fire the bootstrap errors.

Re: Jquery component warnings

Posted: Mon Jun 14, 2021 6:28 pm
by cpetrovay
I haven't modified any of the files (except the changes as noted above).

I re-downloaded version 2.3, and noticed the files are timestamped 7/15/2019 10:08 AM, and the files on my system are timestamped 7/15/2019 05:05 AM. Would you recommend that I overwrite my files with the 10:08AM version?

Re: Jquery component warnings

Posted: Mon Jun 14, 2021 6:55 pm
by alfa24
No, I'm sorry.
I'm saying that I can't replicate the issue.
I should be on your instance to see it.