Issue Details (XML | Word | Printable)

Key: MDL-16898
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Nicolas Connault
Reporter: Markus Hagman
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Moodle groups index.php not working after upgrade 1.86->1.87 PROBLEM : require_once('HTML/AJAX/JSON.php'). After fix the users area is not updated when viewing groups.

Created: 16/Oct/08 06:49 PM   Updated: 02/Jan/09 08:59 AM
Component/s: AJAX, Groups
Affects Version/s: 1.8.7
Fix Version/s: 1.8.8, 1.9.4

File Attachments: None
Image Attachments:

1. test.jpg
(30 kB)
Issue Links:
Cloners
 

Database: MySQL
Participants: Eloy Lafuente (stronk7), Markus Hagman, Martin Dougiamas, Nicolas Connault, Paul Ortman, Petr Škoda (skodak) and Samuli Karevaara
Security Level: None
QA Assignee: Eloy Lafuente (stronk7)
Resolved date: 02/Jan/09
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
I upgraded 1.86 version to 1.87 version without any problems.

Now it seems there have been some changes in file locations? on ajax?

The file: groups/index.php has a require_once line which wont work because of the require_once('HTML/AJAX/JSON.php');

I thought Moodle wasnt dependent on pear-modules? because that require_once line tries to find the ajax-module in my pear-directory. Correct me if Im wrong.

My fix was to install pear module HTML_AJAX!

After this I got the groups page working again, but when I try to see the attendants on different groups it wont show them on right side. I have to go "Add/remove users" to get the list.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Connault added a comment - 16/Oct/08 07:16 PM
Extending PHP's include_path to include Moodle's lib/pear directory. This omission lead to requiring the pear files twice when they were found, and fatal error when they were not found.

Nicolas Connault added a comment - 16/Oct/08 08:42 PM
This fix will require a rebuild of 1.8.7

Eloy Lafuente (stronk7) added a comment - 18/Oct/08 01:36 AM - edited
Hi,

both the 1.8.7 release and last 1.8 weekly packages have been rebuilt. Also, tags in CVS have been moved accordingly so people updating to MOODLE_18_WEEKLY will get the working version.


Eloy Lafuente (stronk7) added a comment - 18/Oct/08 01:58 AM
Tested. Closing.

Paul Ortman added a comment - 22/Oct/08 03:00 AM
I'm seeing the same problems as reported here, but with 1_9_STABLE (currently tested with: Moodle 1.9.3 (Build: 20081021)). With groups/index.php version "1.37.2.4 " clicking on the "Groups" link in the admin block of any course on the site results in a blank page and the following PHP error:

PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'HTML/AJAX/Serializer/JSON.php' (include_path='/var/www/moodle-test/lib/pear:/var/www/moodle-test/lib/pear:.:/usr/share/pear') in /var/www/moodle-test/group/index.php on line 14, referer: https://moodle-test.goshen.edu/course/view.php?id=1002

Commenting out that line gets most of the group functionality to work, but the original error reported above still rears its head.

PHP Fatal error: Call to undefined function json_encode() in /var/www/moodle-test/group/index.php on line 64, referer: https://moodle-test.goshen.edu/group/index.php?id=1002&group=161

Note, we're running PHP 5.1.6 (which I believe should still be supported for version 1.9.x), it does not have a json_encode() function which breaks the viewing of group members.

So, I think for 1.9.4 you need to revert lines 48-65 to an earlier version as well.


Samuli Karevaara added a comment - 03/Nov/08 11:08 PM
We have PHP 5.2.4 and Moodle 1.9.3+ and the group/index.php page is blank.

Nicolas Connault added a comment - 03/Nov/08 11:49 PM
Please tell us if the file lib/pear/HTML/AJAX/Serializer/JSON.php is actually in your working copy. If it is not, then it means your working copy is botched up and you need to check a new one out from scratch.

There is absolutely no reason why this bug should occur considering the state of 1.8.7 and 1.9.3


Paul Ortman added a comment - 04/Nov/08 12:12 AM
root@moodle $ ls -lh lib/pear/HTML/AJAX/Serializer/JSON.php
ls: lib/pear/HTML/AJAX/Serializer/JSON.php: No such file or directory

root@moodle $ ls -lh lib/pear/HTML
total 136K
rwxr-x-- 1 root apache 35K Oct 3 03:09 AJAX.php
drwxr-x--- 2 root apache 4.0K Oct 16 16:35 CVS
rw-r---- 1 root apache 12K Sep 24 2006 Common.php
drwxr-x--- 5 root apache 4.0K Dec 19 2007 QuickForm
rw-r---- 1 root apache 75K Sep 24 2006 QuickForm.php

As you can see, in a CVS checkout, we don't even have an AJAX directory, much less the JSON.php file. (CVS 20081016 of 1.9 STABLE)



Paul Ortman added a comment - 04/Nov/08 01:09 AM
You're correct, a fresh checkout of MOODLE_19_STABLE does have the files present, but a cvs -z3 -d up on an already checked out MOODLE_19_STABLE never adds the directories or files below lib/pear/HTML for AJAX. Is there something I'm somehow missing about using cvs? Does this happen regularly? <snide>Does breakage like this provide a good reason to move to a modern, cross platform, and user friendly VCS like bzr or (on at least one of those points) git?</snide>

Thanks for help debugging this. Now I get the pleasure of moving our custom code to a newly checked out version...


Martin Dougiamas added a comment - 04/Nov/08 10:17 AM
Nicolas, there is something funny going on with the checkin...

http://cvs.moodle.org/moodle/lib/pear/HTML/AJAX/Serializer/JSON.php?view=log&pathrev=

Please don't delete files in CVS and re-add them ... I think it's made CVS confused (it downloaded fine on one site for me but not another).

I found that if I just updated that directory like this:

  1. cvs -q update -dP -r MOODLE_18_STABLE
    U AJAX.php
    P AJAX/Action.php
    P AJAX/Debug.php
    P AJAX/Helper.php
    P AJAX/JSON.php
    P AJAX/Response.php
    P AJAX/Server.php
    P AJAX/Serializer/Error.php
    P AJAX/Serializer/JSON.php
    P AJAX/Serializer/Null.php
    P AJAX/Serializer/PHP.php
    P AJAX/Serializer/Urlencoded.php
    P AJAX/Serializer/XML.php
    U QuickForm/element.php

Then it got the files, and then doing this seemed to bring it all back to normal:

  1. cvs -q update -dP -r MOODLE_19_STABLE
    U AJAX.php
    P AJAX/Action.php
    P AJAX/Debug.php
    P AJAX/Helper.php
    P AJAX/JSON.php
    P AJAX/Response.php
    P AJAX/Server.php
    P AJAX/Serializer/Error.php
    P AJAX/Serializer/JSON.php
    P AJAX/Serializer/Null.php
    P AJAX/Serializer/PHP.php
    P AJAX/Serializer/Urlencoded.php
    P AJAX/Serializer/XML.php
    U QuickForm/element.php

Martin Dougiamas added a comment - 05/Nov/08 10:29 AM
I'll delete the files and re-add

Samuli Karevaara added a comment - 08/Nov/08 12:43 PM
My issue was unrelated to Moodle: the folder /lib/pear/HTML/AJAX/ and it's contents was missing after a subversion merge.

Petr Škoda (skodak) added a comment - 02/Jan/09 08:59 AM
I suppose we can close this one now - did not see any more complaints recently, thanks