JQuery Errors in Moodle

JQuery Errors in Moodle

by Richard Burns -
Number of replies: 14

We have four Moodle Centos Linux servers. (Not my idea). All are running 3.2+ 20161222. They were just upgraded recently.

Three work exactly as expected. One of them, throws a JQuery error on a page with a masked text box. For example, Self Enrollment.

Consequently, the box on the above mentioned Self Enrollment page, labeled Enrollment Key, with the text Click to enter text, is non-functional.

The Javascript console says -

jquery.min.js:2 Uncaught Error: type property can't be changed

    at Function.error (jquery.min.js:2)

    at Object.set (jquery.min.js:2)

    at attr (jquery.min.js:2)

    at Function.access (jquery.min.js:2)

    at init.attr (jquery.min.js:2)

    at new c (first.js:48)

    at editinstance.php?courseid=933&id=2788&type=self:2002

    at Object.execCb (require.min.js:1)

    at b.check (require.min.js:1)

    at b.enable (require.min.js:1)

It was working fine on 3.0.2 before the upgrade. I did another upgrade to 3.2.1, but it didn't help. I have tried everything I can think of, but nothing it fixing it. Any ideas?


Average of ratings: -
In reply to Richard Burns

Re: JQuery Errors in Moodle

by Ken Task -
Picture of Particularly helpful Moodlers
On the troubled server ... what does the apache access/error logs show/say?
Reason I ask, just setup a test course on a CentOS boxen with Moodle 3.2+ (Build: 20161208) while watching realtime logs (access/error).   No errors but did notice that the ajax is calling:
/moodle/lib/ajax/service.php?sesskey=[sessionkeyhere] when accessing the area of a course where one sets the enrollment key.

I know you say you've tried 'everything', but ....

is SeLinux running and is it complaining about something?

How about manually removing any session files in moodledata/sessions/
(while there, check permissions on the sessions directory).

Have you also tried manually 'purging the cache' ... yes, there is a button for it ... am talking manually removing the contents of moodledata/cache/ and moodledata/localcache/ (the latter contains a 'js' directory and somthing might be 'stuck' in there.

Otherwise, turn on debugging and let's see what Moodle might say.

'spirit of sharing', Ken





In reply to Ken Task

Re: JQuery Errors in Moodle

by Richard Burns -

Thanks for responding! I gratefully acknowledge my ‘everything’ is limited by my imagination.

 

I see those same AJAX calls in the SSL Access Logs. That makes sense because we are running on full SSL.

The SSL is also a relatively new thing for us, but I turned it off and it didn’t help. Also the other servers are also running full SSL.

 

SELinux is Disabled.

 

The permissions on the Sessions and the two caches directory’s are 777. Not saying that’s the best way, but that’s what they are.

 

I stopped HTTPD, cleared those files, restarted. No change.

 

I have already enabled full Moodle debugging and nothing is showing up.

 

--

 

Richard Burns

Servers and Systems Administrator | Information Technology

816-415-7633 (office)

816-785-2405 (cell)

 

William Jewell College: Live What You Learn | www.jewell.edu

Please join Jewell in conservation efforts. Print this email only if necessary.

 

From: Ken Task <noreply@moodle.org>
Reply-To: "posts+AAAAAAAAAAIAAAAAAB8ZHgAAAAAAFUTlS26TDvQ8255D38WV@posts.moodle.org" <posts+AAAAAAAAAAIAAAAAAB8ZHgAAAAAAFUTlS26TDvQ8255D38WV@posts.moodle.org>
Date: Wednesday, January 11, 2017 at 6:06 PM
To: Richard Burns <burnsr@william.jewell.edu>
Subject: Moodle in English: Re: JQuery Errors in Moodle

 

icture of Ken Task

Re: JQuery Errors in Moodle

by Ken Task - Thursday, January 12, 2017, 7:35 AM

 

On the troubled server ... what does the apache access/error logs show/say?
Reason I ask, just setup a test course on a CentOS boxen with Moodle 3.2+ (Build: 20161208) while watching realtime logs (access/error).   No errors but did notice that the ajax is calling:
/moodle/lib/ajax/service.php?sesskey=[sessionkeyhere] when accessing the area of a course where one sets the enrollment key.

I know you say you've tried 'everything', but ....

is SeLinux running and is it complaining about something?

How about manually removing any session files in moodledata/sessions/
(while there, check permissions on the sessions directory).

Have you also tried manually 'purging the cache' ... yes, there is a button for it ... am talking manually removing the contents of moodledata/cache/ and moodledata/localcache/ (the latter contains a 'js' directory and somthing might be 'stuck' in there.

Otherwise, turn on debugging and let's see what Moodle might say.

'spirit of sharing', Ken





You can reply to this via email.

In reply to Richard Burns

Re: JQuery Errors in Moodle

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

Sorry to interrupt but I am curious to know which theme are you using, as the problem may be theme related?

thanks

Mary

In reply to Mary Evans

Re: JQuery Errors in Moodle

by Richard Burns -
That was one of my ideas also. But we are using the standard Boost theme with no modifications. Also I switched the theme and nothing changed. I found some errors in CSS but nothing came of it. 

Richard Burns

Servers and Systems Administrator | Information Technology

816-415-7633 (office)

816-785-2405 (cell)

 

William Jewell College: Live What You Learn | www.jewell.edu

Please join Jewell in conservation efforts. Print this email only if necessary.


On Jan 11, 2017, at 9:12 PM, Mary Evans <noreply@moodle.org> wrote:

It's only an avatar...
Re: JQuery Errors in Moodle
by Mary Evans - Thursday, January 12, 2017, 10:41 AM
 

Hi,

Sorry to interrupt but I am curious to know which theme are you using, as the problem may be theme related?

thanks

Mary


You can reply to this via email.

In reply to Ken Task

Re: JQuery Errors in Moodle

by Richard Burns -
My best idea is that it has something to do with the process of hiding secure information. I say this because all other DHTML seems to work except for information hiding. I don't know if Moodle encrypts this information but if it does the process could be broken by some kind of encryption key damage.

On Jan 11, 2017, at 6:06 PM, Ken Task <noreply@moodle.org> wrote:

Picture of Ken Task
Re: JQuery Errors in Moodle
by Ken Task - Thursday, January 12, 2017, 7:35 AM
  On the troubled server ... what does the apache access/error logs show/say?
Reason I ask, just setup a test course on a CentOS boxen with Moodle 3.2+ (Build: 20161208) while watching realtime logs (access/error).   No errors but did notice that the ajax is calling:
/moodle/lib/ajax/service.php?sesskey=[sessionkeyhere] when accessing the area of a course where one sets the enrollment key.

I know you say you've tried 'everything', but ....

is SeLinux running and is it complaining about something?

How about manually removing any session files in moodledata/sessions/
(while there, check permissions on the sessions directory).

Have you also tried manually 'purging the cache' ... yes, there is a button for it ... am talking manually removing the contents of moodledata/cache/ and moodledata/localcache/ (the latter contains a 'js' directory and somthing might be 'stuck' in there.

Otherwise, turn on debugging and let's see what Moodle might say.

'spirit of sharing', Ken






You can reply to this via email.

In reply to Richard Burns

Re: JQuery Errors in Moodle

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

It could be a regression due to MDL-56193.

Also, when replying via Email please remove the original message as this just clutters up the discussion.

If you login to this forum and take a look like at this discussion you will be shocked At the amount of duplicated data that is being added in each email post you  send!!!

Cheers

Mary

In reply to Mary Evans

Re: JQuery Errors in Moodle

by Richard Burns -
>

I saw that about the replies. Sorry about that. I will do better.



I looked at the MDL issue. Maybe.
In reply to Richard Burns

Re: JQuery Errors in Moodle

by Richard Burns -

I cloned the VM to a new VM, and installed a fresh copy of Moodle 3.2.1 with new DB and data directories. The problem went away. As soon as switched it back to the old data the problem came back. I conclude it is NOT the Moodle software and not the OS.

 

I have gone through the most likely suspects in the settings but have found nothing so far.

In reply to Richard Burns

Re: JQuery Errors in Moodle

by Richard Burns -
I worked with our web developer hoping he might have some insight. He found that the problem site was downloading jquery 1.7.2 from ajax.googleapis.com whereas the working site was using jquery 3.1.0. The assumption is that something old is forcing this old JQuery lib in there and the function is non-there. Not sure where this is coming from. I thought it might be some old themes, but I cleared them out and no help. I sure hope a developer out there is reading this and can help.
In reply to Richard Burns

Re: JQuery Errors in Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

On the problem site ... take a gander in /moodledata/localcache/js/ and requirejs directories

Matter of fact, one could remove everything in that directory and Moodle will re-cache it as site is used.

'spirit of sharing', Ken



In reply to Ken Task

Re: JQuery Errors in Moodle

by Richard Burns -
I've already cleared those out multiple times both manually and through the GUI. No help.
In reply to Richard Burns

Re: JQuery Errors in Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

In the strock code of a moodle 31 there is only
jquery-1.2.6.js and a jquery-3.1.0.js

there is no jquery.min.js in stock code.
From the moodle code directory:
find ./ -name jquery.min.js
renders nothing.

In the code of a moodle 32 there is no jQuery.min.js
find ./ -name jquery.min.js
also renders nada

Where is that file found on your system?

Might give you a clue as to what it might be related to.

The only thing one can find related to google has to do with repos (I think).  Located in

/lib/google and there is no .js in there and nothing that I can find that points to a google api.

Since your site is at a college, do you have any customized enrollment plugin which might have been locally developed?

In the area of the troubled course where you cannot click the 'spyglass' .. that's true (nothing will happen) ... if there is no enrollment key to begin with.

Also, what is the order of enrollment methods in this troubled course?  Think sometimes one can 'fix' by re-ordering the enrollment methods ... placing the one desired first and the others there after.

'spirit of sharing', Ken




In reply to Ken Task

Re: JQuery Errors in Moodle

by Richard Burns -

I found the problem. Our Instructional Department manages the content of Moodle. IT just manages the back end. They use a copy called Setmore which provided a nice little JavaScript button to add to the home page. In that button's code, it was pulling that old JQuery Library from Google via their site. 

Here is the basic code - <script id="setmore_script" type="text/javascript" src="https://my.setmore.com/js/iframe/setmore_iframe.js"></script><a id="Setmore_button_iframe" style="float:none" href="https://my.setmore.com/shortBookingPage/OURNUMBER"><img border="none" src="https://my.setmore.com/images/bookappt/SetMore-book-button.png" alt="Book an appointment using SetMore"></a>

Once I removed the code block, it started working.

Thanks for all the help!





In reply to Richard Burns

Re: JQuery Errors in Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Glad to here it's resolved!   Ever feel like Elmer Fudd ... chasin' that 'wascle wabbit'?   Well congrats ... ya caught the rabbit! ;)

'spirit of sharing', Ken