Moodle

lib backup/restorelib duplicate members group

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.4
  • Component/s: Backup
  • 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

The function restore_create_groups_members duplicate members of group in the same course, when teacher restore a course by parts, and any part of the restore file have users, because the lib doesn't use the groups_add_member function, that check if user exists in group, use insert_record without checking first.

Bye

Activity

Hide
Petr Škoda (skodak) added a comment -

should be fixed now, I have added record_exists() because the group lib functions alter dates

thanks a lot for the report and proposed fix !

Show
Petr Škoda (skodak) added a comment - should be fixed now, I have added record_exists() because the group lib functions alter dates thanks a lot for the report and proposed fix !
Hide
Antonio Piedras Morente added a comment -

Thanks Petr,
but for a complete solution for this problem, should be better to create a new index for groups_members table, with fields groupid and userid together, do you agree?

Bye

Show
Antonio Piedras Morente added a comment - Thanks Petr, but for a complete solution for this problem, should be better to create a new index for groups_members table, with fields groupid and userid together, do you agree? Bye
Hide
Tim Hunt added a comment -

Tested and reviewed code and it works. Thanks for the report and the fix. Closing.

Show
Tim Hunt added a comment - Tested and reviewed code and it works. Thanks for the report and the fix. Closing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: