Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-53407

CSS class `editing` is added to the body even if the user may not edit a course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.4, 3.0.2
    • Fix Version/s: 2.9.6, 3.0.4
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      1. Log on as a user who is a teacher in a course, but not an administrator of the page
      2. Navigate to that course
      3. Switch on editing mode
      4. Inspect the `body` element's CSS classes. `editing` should present, as the user is able to edit her own course.
      4. Navigate to the front page (not the dashboard)
      5. Inspect the `body` element's CSS classes. `editing` should not be present, as the user is not able to edit the front page.

      Show
      1. Log on as a user who is a teacher in a course, but not an administrator of the page 2. Navigate to that course 3. Switch on editing mode 4. Inspect the `body` element's CSS classes. `editing` should present, as the user is able to edit her own course. 4. Navigate to the front page (not the dashboard) 5. Inspect the `body` element's CSS classes. `editing` should not be present, as the user is not able to edit the front page.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-53407-editing-css

      Description

      If a user (who is a teacher in some course) chooses to be in editing mode, the CSS class `editing` is added to the body of every page, even after the user navigates to a page/course/frontpage that she may not edit.

      This came up when I used a theme that uses this class in order to adapt the display. It surrounds block areas with dashed lines, indicating that these may be edited / that they are drop zones for blocks. The dashed lines were also visible to users that are not allowed to edit the page that they are on.

      WHAT I EXPECTED
      The CSS class `editing` should only be added if the user is in editing mode AND she is allowed to edit the rendered page.

      WHAT ACTUALLY HAPPENED
      If the user is in editing mode, the CSS class `editing` is added on every page.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/May/16