Moodle

Roles are not renamed when a course is first created

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9, 1.9.1, 1.9.2
  • Fix Version/s: 1.9.4
  • Component/s: Course, Roles / Access
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When you first create a course, you have the opportunity to rename the roles. Any entries you make are ignored. New role names are only applied when you update an existing course.

Steps to reproduce:

1. Go to /course/edit.php and create a new course
2. Rename some of the roles
3. Submit the form

Expected result:

Redirect to /admin/roles/assign.php, which lists the roles with their new names, and the old names in brackets.

Actual result:

Redirect to /admin/roles/assign.php with only the default role names displayed.

This is because create_course() in /course/lib.php lacks the code to handle role renaming. It does exist in update_course(), so I copied it from there (with some minor modifications). Please see the attached patch.

Activity

Hide
Tim Hunt added a comment -

I just spotted this, and am going to fix it (but without copying and pasting code!)

Show
Tim Hunt added a comment - I just spotted this, and am going to fix it (but without copying and pasting code!)
Hide
Helen Foster added a comment -

Chris, thanks for your very clear report, and Tim, thanks for fixing the issue

Show
Helen Foster added a comment - Chris, thanks for your very clear report, and Tim, thanks for fixing the issue

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: