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

themedesignermode doesn't exist prior to setting it to Yes first time

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.4
    • Component/s: Themes
    • Labels:
    • Environment:
      Any
    • Testing Instructions:
      Hide

      New conversion / possibly new install of 2.0
      Switch debug mode on before clicking Theme selector, without changing Theme settings first

      Show
      New conversion / possibly new install of 2.0 Switch debug mode on before clicking Theme selector, without changing Theme settings first
    • Workaround:
      Hide

      Either precreate $CFG->themedesignermode=0 in install (tidy),
      or use !isset($CFG->themedesignermode) wrapper in /theme/index.php (less tidy)

      Show
      Either precreate $CFG->themedesignermode=0 in install (tidy), or use !isset($CFG->themedesignermode) wrapper in /theme/index.php (less tidy)
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull Master Branch:
      wip-MDL-27825-master

      Description

      A bug appears only if you have debug switched on, namely that the themedesignermode object is not pre-created in the install of Moodle 2.0(.3)
      If debug mode is on, then repeated attempts at finding themedesignermode in /theme/index.php at line 98 (one per theme) result in copious errors.

        Gliffy Diagrams

          Activity

          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for reporting this.

          I've put it on our backlog and we'll try to get to it as soon as we can.

          Show
          salvetore Michael de Raadt added a comment - Thanks for reporting this. I've put it on our backlog and we'll try to get to it as soon as we can.
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Hi guys,

          I've fixed this by changing the check to empty($CFG...) instead of !$CFG.
          I've put this up for integration now but if you could please check that would be great.

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Hi guys, I've fixed this by changing the check to empty($CFG...) instead of !$CFG. I've put this up for integration now but if you could please check that would be great. Cheers Sam
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Uhm, this is strange, I've just installed 2.0.x current from scratch and I got the config record in DB, so I didn't get any notice at all:

          205 | themedesignermode | 0

          In any case, I deleted that record and then got a bunch of "PHP Notice: Undefined property..." notices, so I thin it is better to have this change applied.

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Uhm, this is strange, I've just installed 2.0.x current from scratch and I got the config record in DB, so I didn't get any notice at all: 205 | themedesignermode | 0 In any case, I deleted that record and then got a bunch of "PHP Notice: Undefined property..." notices, so I thin it is better to have this change applied.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Passing tests.

          As commented above, I was not able to reproduce the problem as far as installation generated the config setting with value = 0.

          Anyway, I've forced it (by deleting the config record) and once the fix was applied, notices went out. I think that's enough.

          Ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Passing tests. As commented above, I was not able to reproduce the problem as far as installation generated the config setting with value = 0. Anyway, I've forced it (by deleting the config record) and once the fix was applied, notices went out. I think that's enough. Ciao
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Upstream, upstream, this is part of upstream, upstream... thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Upstream, upstream, this is part of upstream, upstream... thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Aug/11