Jquery component warnings

Third party plugins, patches, bugfixes
Post Reply
cpetrovay
Newbie
Posts: 4
Joined: Mon Jan 11, 2021 5:36 pm

Jquery component warnings

Post 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.
Last edited by cpetrovay on Fri Jun 11, 2021 5:34 pm, edited 1 time in total.
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: Jquery component warnings

Post by alfa24 »

Which (relative) URL is giving you the 404s?
Per supporto GRATUITO contattatemi in privato qui
cpetrovay
Newbie
Posts: 4
Joined: Mon Jan 11, 2021 5:36 pm

Re: Jquery component warnings

Post by cpetrovay »

I've noticed the problem on http:// serverroot /appCore/index.php?r=adm/usermanagement/show
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: Jquery component warnings

Post 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]));
Per supporto GRATUITO contattatemi in privato qui
cpetrovay
Newbie
Posts: 4
Joined: Mon Jan 11, 2021 5:36 pm

Re: Jquery component warnings

Post 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.
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: Jquery component warnings

Post by alfa24 »

An original 2.3 /appCore/index.php?r=adm/usermanagement/show won't fire the bootstrap errors.
Per supporto GRATUITO contattatemi in privato qui
cpetrovay
Newbie
Posts: 4
Joined: Mon Jan 11, 2021 5:36 pm

Re: Jquery component warnings

Post 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?
alfa24
Senior Boarder
Posts: 1985
Joined: Fri Nov 24, 2017 8:45 am

Re: Jquery component warnings

Post 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.
Per supporto GRATUITO contattatemi in privato qui
Post Reply