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

styles_color.css problem effecting forum unread post highlighting

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.6
    • Component/s: Forum, Themes
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The standard styles_color.css contains an ".unread" class and a number of classes specific to the forum (see http://docs.moodle.org/en/CSS_styles_color.css#Forum).

      A forum main page uses the ".unread" class to specify the style for the values in the unread column.

      Pages displaying posts...
      *in threaded view use the class "forumthread unread" to specify the style for unread headers
      *in nested view use the class "forumpost unread" to specify the style for unread posts

      In styles_color.css the "forumthread unread" class is specified as:
      .forumthread .unread {
      background: #FFD991;
      }

      There is no specification for the "forumpost unread" class, which in itself is not a problem. However, there is no specification for either ".forumthread" or ".forumpost".

      Combining two classes together (e.g. as done above with .forumthread .unread) adds nothing to the style (i.e. the "background: #FFD991;" is ignored). The only reason the "forumthread unread" and "forumpost unread" classes work is because there is an ".unread" class specified in styles_color.css. This results in unread posts failing to be highlighted in various themes that do not include the styles_color.css or a specific ".unread" class (examples include formal_white, chameleon, etc.).

      Moodle.org forums are exhibiting a problem with highlighting unread posts where the nested view correctly differentiates between read and unread posts but the threaded view highlights everything as unread. I believe this problem is tied to the coding of the CSS associated with "forumthread unread" and "forumthread read" described above.

      Combining two classes together is done because you want the style from both to be applied. There is no need to specify a combined class in a CSS unless you desire it for a placeholder.

      Proposed Solution:
      The ".unread" class needs to be a part of every Moodle provided theme. Either include it in *_color.css or include styles_color.css in the standardsheets array in config.php.

      In the forum section of styles_color.css all of the classes need to be specified before they are combined with other classes (e.g. forumpost and forumthread).

      I am including a test file that illustrates behavior from combining classes in case anyone wants to experiment with the underlying problem identified here.

        Gliffy Diagrams

          Attachments

          1. MDL-18971.patch
            0.9 kB
          2. MDL-18971v2.patch
            3 kB
          3. MDL-18971v3.patch
            9 kB
          4. test.html
            0.8 kB

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  21/Oct/09