Moodle

group/members.php: does not show current group membership when you click on user

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.4
  • Component/s: Groups
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

With debug developer enabled... in the group/members.php page (where you add and remove users to/from a group)... I get one JS script that disables the add and remove buttons.

The exact error is:

invalid flag after regular expression (line 136)
onfocus(focus )

and looking at the underlying code... I see something like:

...
...
132<div id="content-i1" class="i1"><div id="content-i2" class="i2"><div id="content-i3" class="i3 clearfix"><script type="text/javascript">
133//<![CDATA[
134var userSummaries = Array(
135<br />
136<b>Notice</b>: Undefined variable: nonmembers in <b>/Users/stronk7/cvs_moodle/moodle_19_stable/group/members.php</b> on line <b>162</b><br />
137<br />
138<b>Notice</b>: Undefined variable: nonmembers in <b>/Users/stronk7/cvs_moodle/moodle_19_stable/group/members.php</b> on line <b>164</b><br />
139<br />
140<b>Warning</b>: Invalid argument supplied for foreach() in <b>/Users/stronk7/cvs_moodle/moodle_19_stable/group/members.php</b> on line <b>164</b><br />
141);
142
143function updateUserSummary() {
...
...

See that those PHP notices are the problem, breaking JS. With debug off everything looks ok.

Assigning to Sam Marshll as he made some recent changes in that interface... TIA !

Ciao

Issue Links

Activity

Hide
Sam Marshall added a comment -

(I changed the summary to reflect the impact on users.)

You are right, it looks like I broke this. (Hrmmm... why didn't I notice at the time...) Sorry.

Here is a patch that fixes it. I've done brief testing on this, it appeared to work. Please approve & I'll check it in.

Show
Sam Marshall added a comment - (I changed the summary to reflect the impact on users.) You are right, it looks like I broke this. (Hrmmm... why didn't I notice at the time...) Sorry. Here is a patch that fixes it. I've done brief testing on this, it appeared to work. Please approve & I'll check it in.
Hide
Sam Marshall added a comment -

To clarify, brief testing = one course, 3 groups, 2 users, on IE7+Ff2; making sure that the 2 groups showed up and went away when I clicked between the user who was in two groups and the one who was in none.

Show
Sam Marshall added a comment - To clarify, brief testing = one course, 3 groups, 2 users, on IE7+Ff2; making sure that the 2 groups showed up and went away when I clicked between the user who was in two groups and the one who was in none.
Hide
Sam Marshall added a comment -

This now works, not sure if my patch was put in or someone else's.

Show
Sam Marshall added a comment - This now works, not sure if my patch was put in or someone else's.
Hide
Tim Hunt added a comment -

Closing. Thanks guys.

Show
Tim Hunt added a comment - Closing. Thanks guys.
Hide
Yolanda Ordoñez Rufat added a comment -

I found that this bug was resolved with the patch in MDL-15809

Show
Yolanda Ordoñez Rufat added a comment - I found that this bug was resolved with the patch in MDL-15809

People

Dates

  • Created:
    Updated:
    Resolved: