Moodle
  1. Moodle
  2. MDL-37333

Clicking "Clear theme caches" in Default theme selector redirects page to "Select theme for tablet device"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.5.1, 2.6
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide
      1. Go to Site administration -> Appearance -> Themes -> Theme selector.
      2. Click on 'Clear theme caches'.
      3. Confirm the page refreshes to the 'Select device' page first encountered in step 1.
      4. Click on 'Change theme' for the 'default' device.
      5. Click on 'Clear theme caches'.
      6. Confirm the page refreshes to the 'default' device page first encountered in step 4.
      7. Go to Site administration -> Appearance -> Themes -> Theme selector and repeat steps 4-6 for each device confirming that the redirection goes back to the correct page.
      Show
      Go to Site administration -> Appearance -> Themes -> Theme selector. Click on 'Clear theme caches'. Confirm the page refreshes to the 'Select device' page first encountered in step 1. Click on 'Change theme' for the 'default' device. Click on 'Clear theme caches'. Confirm the page refreshes to the 'default' device page first encountered in step 4. Go to Site administration -> Appearance -> Themes -> Theme selector and repeat steps 4-6 for each device confirming that the redirection goes back to the correct page.
    • Workaround:
      Hide

      Go instead to Appearance > Theme settings and switch off (disable = uncheck the box) for 'Detect Mobile devices'. Now go beck to Appearance > Theme selector and you will see the FULL list of themes you can choose from for the DEFAULT theme. Once you have selected your chosen theme, you can go back to Theme settings and enable the 'Detect mobile devices' once again.

      Show
      Go instead to Appearance > Theme settings and switch off (disable = uncheck the box) for 'Detect Mobile devices'. Now go beck to Appearance > Theme selector and you will see the FULL list of themes you can choose from for the DEFAULT theme. Once you have selected your chosen theme, you can go back to Theme settings and enable the 'Detect mobile devices' once again.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
      wip-MDL-37333_M24
    • Pull 2.5 Branch:
      wip-MDL-37333_M25
    • Pull Master Branch:
      wip-MDL-37333_master
    • Rank:
      46947

      Description

      When you CLICK on "Clear theme caches" above the "Default" in Theme selector 'Select Device' page, the page you are on changes to "Select theme for tablet device". Surely this is wrong, as you should be still in the 'Select device' theme selector page.

      1. index.php
        10 kB
        Gareth J Barnard
      1. MDL-37333_after.jpg
        35 kB
      2. MDL-37333_before.jpg
        32 kB

        Activity

        Hide
        Helen Foster added a comment -

        Mary, thanks for your report. I've just tried and found the same odd behaviour when clicking the clear themes cache button!

        Show
        Helen Foster added a comment - Mary, thanks for your report. I've just tried and found the same odd behaviour when clicking the clear themes cache button!
        Hide
        Mary Evans added a comment -

        Hi Helen,
        Is there a problem with emails from Moodle Tracker, as I did not get notification of your comment here. This seems to happened just recently since the change to https.

        Show
        Mary Evans added a comment - Hi Helen, Is there a problem with emails from Moodle Tracker, as I did not get notification of your comment here. This seems to happened just recently since the change to https.
        Hide
        Helen Foster added a comment -

        Hi Mary,

        There was indeed a problem with tracker notification emails but it should now be fixed. If not, please comment in MDLSITE-2071.

        Show
        Helen Foster added a comment - Hi Mary, There was indeed a problem with tracker notification emails but it should now be fixed. If not, please comment in MDLSITE-2071 .
        Hide
        Mary Evans added a comment -

        I left a comment on MDLSITE-2071 but don't know if anyone got is as nothing came back to me. Although I am a watcher on that tracker issue it is not listing in my Watched items in my JIRA dashboard.

        Show
        Mary Evans added a comment - I left a comment on MDLSITE-2071 but don't know if anyone got is as nothing came back to me. Although I am a watcher on that tracker issue it is not listing in my Watched items in my JIRA dashboard.
        Hide
        Mary Evans added a comment -

        I thought this had been fixed. Just found it again while QA Testing. Can we not fix this for Moodle 2.5???

        Show
        Mary Evans added a comment - I thought this had been fixed. Just found it again while QA Testing. Can we not fix this for Moodle 2.5???
        Hide
        Rajesh Taneja added a comment -

        Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

        For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        If you have any information about this issue or a possible fix please post it here

        Show
        Rajesh Taneja added a comment - Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment If you have any information about this issue or a possible fix please post it here
        Hide
        Mary Evans added a comment -

        Without a doubt this is causing no end of problems for people can someone give me an idea how I can fix this? Thank you

        Show
        Mary Evans added a comment - Without a doubt this is causing no end of problems for people can someone give me an idea how I can fix this? Thank you
        Hide
        Mary Evans added a comment - - edited

        I know you are busy Petr but this is a real problem and one that needs fixing. People are getting stuck in this page saying they cannot select a theme, and the more they click Clear theme caches, the more they end up in THIS "rabbit hole" of a theme selector!!!

        Show
        Mary Evans added a comment - - edited I know you are busy Petr but this is a real problem and one that needs fixing. People are getting stuck in this page saying they cannot select a theme, and the more they click Clear theme caches, the more they end up in THIS "rabbit hole" of a theme selector!!!
        Hide
        Gareth J Barnard added a comment -

        Dear Mary Evans,

        I saw the update on this and got interested in it. So looked in '/theme/index.php' and discovered that when '$device' is empty it is being set to 'tablet' by the last iteration of 'foreach ($devices as $device)' because the same name is being used by two different conceptual 'variables' and the intent of the device parameter is being lost. So, I think the solution is to add a '$device = "";' just before the closing '}' of the 'if (!empty($CFG->enabledevicedetection) && empty($device)) {' test.

        This is because '$device' is being used as a hidden parameter on 'echo $OUTPUT->single_button(new moodle_url('index.php', array('sesskey' => sesskey(), 'reset' => 1, 'device' => $device)), get_string('themeresetcaches', 'admin'));' which causes the 'Select theme for tablet' page to be displayed.

        So, I believe my fix in the position it is will work as it only resets to empty when it is parsed in as empty - bar the $CFG->enabledevicedetection logic - comments please

        Cheers,

        Gareth

        Show
        Gareth J Barnard added a comment - Dear Mary Evans , I saw the update on this and got interested in it. So looked in '/theme/index.php' and discovered that when '$device' is empty it is being set to 'tablet' by the last iteration of 'foreach ($devices as $device)' because the same name is being used by two different conceptual 'variables' and the intent of the device parameter is being lost. So, I think the solution is to add a '$device = "";' just before the closing '}' of the 'if (!empty($CFG->enabledevicedetection) && empty($device)) {' test. This is because '$device' is being used as a hidden parameter on 'echo $OUTPUT->single_button(new moodle_url('index.php', array('sesskey' => sesskey(), 'reset' => 1, 'device' => $device)), get_string('themeresetcaches', 'admin'));' which causes the 'Select theme for tablet' page to be displayed. So, I believe my fix in the position it is will work as it only resets to empty when it is parsed in as empty - bar the $CFG->enabledevicedetection logic - comments please Cheers, Gareth
        Hide
        Gareth J Barnard added a comment -

        Moodle 2.5 fixed 'index.php'.

        Show
        Gareth J Barnard added a comment - Moodle 2.5 fixed 'index.php'.
        Hide
        Gareth J Barnard added a comment -

        Or use a different variable name in the 'for' loop

        Show
        Gareth J Barnard added a comment - Or use a different variable name in the 'for' loop
        Hide
        Mary Evans added a comment -

        If you think you can do this Gareth, then assign this to yourself and fix it!
        Just let me know when you need it pushing for integration review?

        Show
        Mary Evans added a comment - If you think you can do this Gareth, then assign this to yourself and fix it! Just let me know when you need it pushing for integration review?
        Hide
        Gareth J Barnard added a comment -

        Dear Mary Evans,

        As soon as I get time I'll assign to myself and publish fixes for M2.4+.

        Cheers,

        Gareth

        Show
        Gareth J Barnard added a comment - Dear Mary Evans , As soon as I get time I'll assign to myself and publish fixes for M2.4+. Cheers, Gareth
        Hide
        Gareth J Barnard added a comment - - edited

        Although I don't think it's a 'blocker' as it is still possible to continue using Moodle without any negative effect - just use the navigation menu to select the theme selector.

        Show
        Gareth J Barnard added a comment - - edited Although I don't think it's a 'blocker' as it is still possible to continue using Moodle without any negative effect - just use the navigation menu to select the theme selector.
        Hide
        Gareth J Barnard added a comment -

        Dear Mary Evans,

        Initial fix applied to master branch. Thoughts before I replicate?

        Cheers,

        Gareth

        Show
        Gareth J Barnard added a comment - Dear Mary Evans , Initial fix applied to master branch. Thoughts before I replicate? Cheers, Gareth
        Hide
        Gareth J Barnard added a comment -

        Dear Mary Evans,

        All done. Now waiting for peer review.

        Cheers,

        Gareth

        Show
        Gareth J Barnard added a comment - Dear Mary Evans , All done. Now waiting for peer review. Cheers, Gareth
        Hide
        Mary Evans added a comment -

        Submitting this for integration review. Code looks OK.

        Show
        Mary Evans added a comment - Submitting this for integration review. Code looks OK.
        Hide
        Dan Poltawski added a comment -

        Integrated to master, 25 and 24 - thanks Gareth!

        Show
        Dan Poltawski added a comment - Integrated to master, 25 and 24 - thanks Gareth!
        Hide
        Andrew Davis added a comment -

        Works as described. Passing.

        Show
        Andrew Davis added a comment - Works as described. Passing.
        Hide
        Damyon Wiese added a comment -

        Thanks again for another week of fixes, improvements and testing. These changes have been released to the world.

        Cheers, Damyon

        Show
        Damyon Wiese added a comment - Thanks again for another week of fixes, improvements and testing. These changes have been released to the world. Cheers, Damyon

          People

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

            Dates

            • Created:
              Updated:
              Resolved: