Moodle

In add/remove users in group, not is displayed the groups of selected user in potential members list

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.3
  • Component/s: Groups
  • Labels:
    None
  • Environment:
    1.9.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1
  • Database:
    PostgreSQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When you go to "add/remove users in group page", is displayed the next notice:
<br />
<b>Notice</b>: Undefined variable: nonmembers in <b>/www/moodle/group/members.php</b> on line <b>156</b><br />
<br />
<b>Notice</b>: Undefined variable: nonmembers in <b>/www/moodle/group/members.php</b> on line <b>158</b><br />
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/www/moodle/group/members.php</b> on line <b>158</b><br />

inside a javascript generated block.

The error occurs because the $nonmembers array is not initialized in script: /moodle/group/members.php

But if you add this line:
$nonmembers = $usergroups;

before line:
$membercnt = count($nonmembers);

the script works fine.

bye.

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

should be fixed now in cvs, I used a bit different solution, there were some more undefined arrays there

thanks for the report!

Show
Petr Škoda (skodak) added a comment - should be fixed now in cvs, I used a bit different solution, there were some more undefined arrays there thanks for the report!
Hide
Antonio Piedras Morente added a comment -

thanks to you for your quickly change )

Cheers

Show
Antonio Piedras Morente added a comment - thanks to you for your quickly change ) Cheers
Hide
Jerome Mouneyrac added a comment -

I tested Add/remove user page, no warning are displayed. Thanks.

Show
Jerome Mouneyrac added a comment - I tested Add/remove user page, no warning are displayed. Thanks.

Dates

  • Created:
    Updated:
    Resolved: