Moodle
  1. Moodle
  2. MDL-13268

capcurrent class should be defined in all moodle themes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5, 1.9
    • Fix Version/s: 1.8.6, 1.9.1
    • Component/s: Accessibility, Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      30628

      Description

      On the roles over-ride page, a capcurrent class is defined in order to highlight those capabilities which are currently "not set" or "inherited", in the ALLOW column. It is extremely important that the current theme has this capcurrent class defined otherwise it won't be highlighted.
      The problem is that in standard theme the capcurrent class is located in styles_color.css:
      #admin-roles-override .capcurrent {
      background-color:#FFFFFF;
      border: 1px solid #cecece;
      }

      The problem occurs when either of the following occur:
      1- the theme's config.php file does not have $THEME->standardsheets = true;
      2- the theme's config.php file does not have $THEME->standardsheets = array('styles_color');
      3- the theme does not define #admin-roles-override .capcurrent {} in its own CSS files.

      At the moment, the (moodle regular distribution) themes which refer to styles_color.css in their config.php file are the following:
      cornflower, metal, oceanblue, standardblue, standardgreen, standardlogo, standardred, standardwhite, wood.

      FIXING SUGGESTIONS:

      1- Those other themes part of moodle distribution should be upgraded so that capcurrent works: chameleon, formal_white. Those two themes are very popular and should be upgraded ASAP.
      2- Themes developers should be advised of this problem. (I have posted a ref. to this bug in the Themes forum).

      Joseph

        Activity

        Hide
        Urs Hunkler added a comment -

        I added the CSS in Chameleon.

        Show
        Urs Hunkler added a comment - I added the CSS in Chameleon.
        Hide
        Urs Hunkler added a comment -

        There is also a related bug in standard/styles_color.css:

        Several "#admin-roles" related CSS definitions are just added at the end of the file in the "Modules: Workshop" section but they have nothing got to do with that section.

        The border width and style definitions must be placed in styles_layout in the correct section and not in the color file.

        The CSS definition in the color file needs to be:
        #admin-roles-override .capcurrent

        { background-color: #FFFFFF; border-color: #cecece; }

        If developers don't care about how they add CSS they break the very flexible Moodle theme handling

        Show
        Urs Hunkler added a comment - There is also a related bug in standard/styles_color.css: Several "#admin-roles" related CSS definitions are just added at the end of the file in the "Modules: Workshop" section but they have nothing got to do with that section. The border width and style definitions must be placed in styles_layout in the correct section and not in the color file. The CSS definition in the color file needs to be: #admin-roles-override .capcurrent { background-color: #FFFFFF; border-color: #cecece; } If developers don't care about how they add CSS they break the very flexible Moodle theme handling
        Hide
        Joseph Rézeau added a comment -

        Thanks Urs. Who will upgrade the formal_white theme? I think it's a popular theme.
        Joseph

        Show
        Joseph Rézeau added a comment - Thanks Urs. Who will upgrade the formal_white theme? I think it's a popular theme. Joseph
        Hide
        Urs Hunkler added a comment -

        Andrea, I added you as watcher. You may consider to add the role CSS into formal_white too.

        Show
        Urs Hunkler added a comment - Andrea, I added you as watcher. You may consider to add the role CSS into formal_white too.
        Hide
        Andrea Bicciolo added a comment -

        Added to formal_white (MOODLE_18_STABLE, MOODLE_19_STABLE and HEAD) the following classes:

        .rolecap .inherit.capdefault, .rolecap .allow.capdefault

        { background-color:#E3DFD4; }

        #admin-roles-override .capcurrent

        { background-color:#E3DFD4; }

        Thanks for the report.

        Show
        Andrea Bicciolo added a comment - Added to formal_white (MOODLE_18_STABLE, MOODLE_19_STABLE and HEAD) the following classes: .rolecap .inherit.capdefault, .rolecap .allow.capdefault { background-color:#E3DFD4; } #admin-roles-override .capcurrent { background-color:#E3DFD4; } Thanks for the report.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi, can this be closed? TIA!

        Show
        Eloy Lafuente (stronk7) added a comment - Hi, can this be closed? TIA!
        Hide
        Andrea Bicciolo added a comment -

        Eloy, the issue in formal_white has benns solved, and AFAIK Urs solved it in chamaeleon too. I think it could be closed.

        Show
        Andrea Bicciolo added a comment - Eloy, the issue in formal_white has benns solved, and AFAIK Urs solved it in chamaeleon too. I think it could be closed.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Thanks for feedback, Andrea!

        Resolving this as fixed... ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Thanks for feedback, Andrea! Resolving this as fixed... ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        And closing! Re-ciao

        Show
        Eloy Lafuente (stronk7) added a comment - And closing! Re-ciao

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: