Moodle
  1. Moodle
  2. MDL-27825

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical 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
    • Rank:
      17503

      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.

        Activity

        Hide
        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
        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
        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
        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
        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
        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
        Eloy Lafuente (stronk7) added a comment -

        Integrated, thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
        Hide
        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
        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
        Eloy Lafuente (stronk7) added a comment -

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

        Show
        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: