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

Moodle Core Themes - Top cut off of large text in Summary

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      Before testing enable "Allow theme change by URL" in Appearance/Themes/Theme settings

      1. In any course page turn editing on and CLICK on the edit icon in Section 0
      2. Type a line of text, highlight it and change FONT-SIZE to 7(36pt) - SAVE changes. It is IMPORTANT than NO 'H1, H2, H3,...heading tags are used.
      3. TEST Anomaly, Formal White and Standard themes to see that the full height of the text is visible.
      Show
      Before testing enable "Allow theme change by URL" in Appearance/Themes/Theme settings In any course page turn editing on and CLICK on the edit icon in Section 0 Type a line of text, highlight it and change FONT-SIZE to 7(36pt) - SAVE changes. It is IMPORTANT than NO 'H1, H2, H3,...heading tags are used. TEST Anomaly, Formal White and Standard themes to see that the full height of the text is visible.
    • Workaround:
      Hide

      Add .path-course-view .section .summary

      {line-height:normal;}

      to theme/base/style/course.css

      Show
      Add .path-course-view .section .summary {line-height:normal;} to theme/base/style/course.css
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-32385_master

      Description

      When creating/editing a Summary if the first line of text has a "Font size" that is set to any value above 5 (18pt) and the "Format" is set to anything but a "Heading" then the top of the text is cut off. I have tested all the themes while viewing a fresh installation of Moodle 2.2.2 and have found the issue in three themes. The browser I am using is Firefox.

      Replicable when using the following themes:

      Anomaly
      Formal White
      Standard

      Testing:

      1] From the Front Page or within a course turn editing on
      2] With editing on click "Edit summary" icon
      3] Use any Font type, use a Font size larger than 5 (18pt), and use any format but the "Headings"
      4] Type a line of text
      5] Save changes
      6] In the above mentioned themes the top of the text will be cut off.

      The screen shots taken have the following settings for the text set:
      Font type: Arial
      Font Size: 7 (36pt)
      Format: Paragraph

        Gliffy Diagrams

          Attachments

          1. Anomaly-Theme-Test.png
            Anomaly-Theme-Test.png
            12 kB
          2. Anomaly-Theme-Test.png
            Anomaly-Theme-Test.png
            15 kB
          3. Formal-White-Test.png
            Formal-White-Test.png
            13 kB
          4. Formal-White-Test.png
            Formal-White-Test.png
            15 kB
          5. Standard-Theme-Test.png
            Standard-Theme-Test.png
            13 kB
          6. Standard-Theme-Test.png
            Standard-Theme-Test.png
            16 kB
          7. Style_Analysis.jpg
            Style_Analysis.jpg
            308 kB

            Activity

            Hide
            joseph.jacelone Joseph Jacelone added a comment -

            Re-added screen captures to show the error without editing turned on.

            Show
            joseph.jacelone Joseph Jacelone added a comment - Re-added screen captures to show the error without editing turned on.
            Hide
            saswatpadhi Saswat Padhi added a comment - - edited

            I was analysing the elements styles. And I reached the following conclusion.
            I have also uploaded a screenshot that shows why the top of the text is chopped off.

            There is a default font-size and line-height for the summary, in the theme files (as it uses style .path-course-view .section).
            But, when we use a custom font size in the summary editor, the font-size is overridden (by a span), but the line-height remains as inherited.

            Further, the themes which do not set the summary style to .path-course-view .section, show the summary correctly.

            Show
            saswatpadhi Saswat Padhi added a comment - - edited I was analysing the elements styles. And I reached the following conclusion. I have also uploaded a screenshot that shows why the top of the text is chopped off. There is a default font-size and line-height for the summary, in the theme files (as it uses style .path-course-view .section ). But, when we use a custom font size in the summary editor, the font-size is overridden (by a span), but the line-height remains as inherited. Further, the themes which do not set the summary style to .path-course-view .section , show the summary correctly.
            Hide
            saswatpadhi Saswat Padhi added a comment -

            I couldn't notice this issue with the Anomaly theme.
            Although the line-height is inherited, it is large enough to fit 7pt text.

            And Standard and Formal White are indeed the only 2 themes with this issue.
            I have added 1 new rule per theme to resolve this issue :

            Standard

            .path-course-view .section .summary {font-size:0.95em;line-height:normal;}

            Formal White

            .path-course-view .section .summary{line-height:normal;}

            This overrides the 1.2em line-height to normal line-height.

            Pull master Diff : https://github.com/SaswatPadhi/moodle/compare/master...MDL-32385
            Pull MDL22 Diff : https://github.com/SaswatPadhi/moodle/compare/MOODLE_22_STABLE...MDL-32385_22

            Show
            saswatpadhi Saswat Padhi added a comment - I couldn't notice this issue with the Anomaly theme. Although the line-height is inherited, it is large enough to fit 7pt text. And Standard and Formal White are indeed the only 2 themes with this issue. I have added 1 new rule per theme to resolve this issue : Standard .path-course-view .section .summary {font-size:0.95em;line-height:normal;} Formal White .path-course-view .section .summary{line-height:normal;} This overrides the 1.2em line-height to normal line-height. Pull master Diff : https://github.com/SaswatPadhi/moodle/compare/master...MDL-32385 Pull MDL22 Diff : https://github.com/SaswatPadhi/moodle/compare/MOODLE_22_STABLE...MDL-32385_22
            Hide
            joseph.jacelone Joseph Jacelone added a comment -

            Thank you for the update! I will inform our devs to have or local repositories updated. Thank you again for all your hard work!!

            Sincerely,

            Joe

            Show
            joseph.jacelone Joseph Jacelone added a comment - Thank you for the update! I will inform our devs to have or local repositories updated. Thank you again for all your hard work!! Sincerely, Joe
            Hide
            lazydaisy Mary Evans added a comment -

            @Michael

            Can you please explain the significance of the 'Partner' label this issues has attached to it? Do I treat this in the normal way fixing master and Moodle stable branches?

            Please advise?

            Show
            lazydaisy Mary Evans added a comment - @Michael Can you please explain the significance of the 'Partner' label this issues has attached to it? Do I treat this in the normal way fixing master and Moodle stable branches? Please advise?
            Hide
            lazydaisy Mary Evans added a comment - - edited

            I have added the patch to BASE theme. This way it will fix Anomaly, Formal White and Standard, as all themes inherit styles from Base theme.

            Cheers

            Mary

            Show
            lazydaisy Mary Evans added a comment - - edited I have added the patch to BASE theme. This way it will fix Anomaly, Formal White and Standard, as all themes inherit styles from Base theme. Cheers Mary
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Mary - this has been integrated now.

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Mary - this has been integrated now.
            Hide
            phalacee Jason Fowler added a comment -

            looks good to me

            Show
            phalacee Jason Fowler added a comment - looks good to me
            Hide
            poltawski Dan Poltawski added a comment -

            Bonza mate!

            Your changes have made it into the Moodle release! Its time to celebrate! Put a shrimp on the barbie and grab a stubby.

            Hooroo

            Show
            poltawski Dan Poltawski added a comment - Bonza mate! Your changes have made it into the Moodle release! Its time to celebrate! Put a shrimp on the barbie and grab a stubby. Hooroo
            Hide
            joseph.jacelone Joseph Jacelone added a comment -

            I second what Dan said!!

            Thank you for all your help Saswat & Mary!!

            Show
            joseph.jacelone Joseph Jacelone added a comment - I second what Dan said!! Thank you for all your help Saswat & Mary!!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12