Moodle hacking: MAGPIE_FETCH_TIME_OUT from 5 seconds to 20 seconds

16 Apr

Being open source and providing some documentation are not enough to achieve high quality software. Moodle e-learning system is open source down to its roots, got lots of documentation, too. However that did not help today much as I was trying to pinpoint a problem regarding adding RSS feeds.

The case was that I was trying to add an RSS feed for a course that used Moodle (version 1.9.x) but getting an error message like

“There was an error loading this rss feed. You may want to verify the url you have specified before using it.”

And then the page automatically redirected to Add Rss Feed page. My debugging efforts would be much shorter if Moodle did the following things:

– When there is an error do not automatically redirect after showing the error message. Just stop there. So that I can copy and paste the message for a Google search. So other users can copy and paste the message to their e-mails, etc.

– When you try to print an error please be as specific as possible. Telling that there is an error for a perfectly valid RSS url (and one which can be fetched perfectly from the server’s command line using curl) does not help much.

– Provide some hints so that programmers / debuggers / system administrators will have a clue about the exact file / directory location of the error.

The result? After some experiments I discovered that the culprit was MAGPIE_FETCH_TIME_OUT variable which was set in the init() function which was defined in file in moodle/lib/magpie. I changed it from 5 seconds to 20 seconds and voilà! RSS feeds work fine now, I can add them and view them. Oh by the way, it would be great if there was some place in the web interface to set MAGPIE_FETCH_TIME_OUT, I searched but could not find (is there? Where?).

Now maybe somebody will say I should be a good open source citizen and send some patches to Moodle… But farnkly, I’m tired. That whole debugging session on a convoluted piece of PHP code over a VPN-connected ssh commandline that was not very responsive made really tired. So maybe somebody else can do it (or maybe this is already solved and I just spent my time in vain… Moodle forums and Google were not very helpful then).

Leave a comment

Posted by on April 16, 2010 in e-Learning, Linux, Programlama


Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: