Moodle

numeric array keys lost where array is returned over mnet.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5
  • Fix Version/s: 1.9.8, 2.0
  • Component/s: MNet
  • Labels:
    None
  • Environment:
    php5.2.0.8, apache2, linux - presume this affects all php5, (if not all php generally).
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

Where the xmlrpc method course_enrolments is called, and the relevant course contains users whose username is numeric (eg 99013362), the caller cannot properly extract the username from the resulting array. The affected usernames are renumbered - 0,1,2,3.....

Non-numeric usernames are unaffected.

To reproduce:
set up 2 moodles, get them both trusting each other, and allowing one another to enrol students in their courses. Create 2 users on moodle A "Fred", and "99013362", attempt to enrol Fred and 99013362 in a course shared by moodle B using the networking / enrolment interface. Observe that only fred appears on the LHS of the mnet enrolment interface.

Issue Links

Activity

Hide
Penny Leach added a comment -

This is a general xmlrpc problem, nothing to do with mnet. It makes me ARGH though!

Show
Penny Leach added a comment - This is a general xmlrpc problem, nothing to do with mnet. It makes me ARGH though!
Hide
Penny Leach added a comment -

I wonder if we should perhaps solve this in a more general way by instead adding something like an "arraykey" field into the objects, and recode based on that before passing the data off to wherever in moodle it's needed, rather than having this specifically solved in the enrolment plugin....

Show
Penny Leach added a comment - I wonder if we should perhaps solve this in a more general way by instead adding something like an "arraykey" field into the objects, and recode based on that before passing the data off to wherever in moodle it's needed, rather than having this specifically solved in the enrolment plugin....
Hide
Penny Leach added a comment - - edited

Also this has been fixed in php 5.2.12 I think:

http://www.php.net/ChangeLog-5.php#5.2.12

quote:

  1. Fixed bug #50285 (xmlrpc does not preserve keys in encoded indexed arrays). (Felipe)

http://bugs.php.net/bug.php?id=50285

Show
Penny Leach added a comment - - edited Also this has been fixed in php 5.2.12 I think: http://www.php.net/ChangeLog-5.php#5.2.12 quote:
  1. Fixed bug #50285 (xmlrpc does not preserve keys in encoded indexed arrays). (Felipe)
http://bugs.php.net/bug.php?id=50285
Hide
Penny Leach added a comment -

Pete I think we should close this - it's a php bug which will be fixed (and people can upgrade if they have this problem).

What do you think?

Show
Penny Leach added a comment - Pete I think we should close this - it's a php bug which will be fixed (and people can upgrade if they have this problem). What do you think?
Hide
Peter Bulmer added a comment -

Fix is in php 5.2.12

Show
Peter Bulmer added a comment - Fix is in php 5.2.12

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: