Moodle
  1. Moodle
  2. MDL-30355

Moodle 2.x Can't Edit Front Page if using My Moodle

    Details

    • Testing Instructions:
      Hide

      Log in as an administrator.
      In Site Administration > Appearance > Navigation, set "Default home page for users" to "My Moodle"
      Click "Save Changes"
      Return to the site home.
      In Settings > Front page settings, click "Turn editing on"

      Show
      Log in as an administrator. In Site Administration > Appearance > Navigation, set "Default home page for users" to "My Moodle" Click "Save Changes" Return to the site home. In Settings > Front page settings, click "Turn editing on"
    • Workaround:
      Hide

      No workaround. The only way to edit the front page under these conditions is to manually edit index.php to fix it.

      Show
      No workaround. The only way to edit the front page under these conditions is to manually edit index.php to fix it.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Rank:
      32738

      Description

      When the default home page for users is set to "My Moodle", the "Turn Editing On" link on the front page redirects to the My Moodle page instead of turning editing on. The only workaround I've found is to set the default home page back to "Site", make the edited and then return the setting back to "My Moodle". Unfortunately, this will mean the site will work differently when an administrator is editing the front page--not a good result.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this.

          This may be due to a recent regression. I've linked another issue that may be caused by the same change.

          I've put it on our backlog.

          In the meantime adding more information, such as screenshots, replication instructions, fix test instructions, a workaround or even a code solution, will help us and other users. If you are able to provide a patch, please add a patch label so we will spot it.

          Show
          Michael de Raadt added a comment - Thanks for reporting this. This may be due to a recent regression. I've linked another issue that may be caused by the same change. I've put it on our backlog. In the meantime adding more information, such as screenshots, replication instructions, fix test instructions, a workaround or even a code solution, will help us and other users. If you are able to provide a patch, please add a patch label so we will spot it.
          Hide
          Bret Miller added a comment -

          ok... Fix instructions for Moodle 2.1.3. Fix is for the main index.php.

          Move this line ("$editing = $PAGE->user_is_editing();") from line 88 to after line 46.
          Note this adds a line so follwing line numbers are 1 more than original.
          On line 62 ("} else if ($CFG->defaulthomepage == HOMEPAGE_MY && (optional_param('redirect', true, PARAM_BOOL) || !$hassiteconfig))

          {", add the following between the two ending parens: " && !$editing" so it now reads: }

          else if ($CFG->defaulthomepage == HOMEPAGE_MY && (optional_param('redirect', true, PARAM_BOOL) || !$hassiteconfig) && !$editing) {

          That's all. Hopefully the fix will now make it into the official stream...

          Show
          Bret Miller added a comment - ok... Fix instructions for Moodle 2.1.3. Fix is for the main index.php. Move this line ("$editing = $PAGE->user_is_editing();") from line 88 to after line 46. Note this adds a line so follwing line numbers are 1 more than original. On line 62 ("} else if ($CFG->defaulthomepage == HOMEPAGE_MY && (optional_param('redirect', true, PARAM_BOOL) || !$hassiteconfig)) {", add the following between the two ending parens: " && !$editing" so it now reads: } else if ($CFG->defaulthomepage == HOMEPAGE_MY && (optional_param('redirect', true, PARAM_BOOL) || !$hassiteconfig) && !$editing) { That's all. Hopefully the fix will now make it into the official stream...
          Hide
          Mary Evans added a comment -
          Show
          Mary Evans added a comment - Here's the commit that was added to fix MDL-30222 https://github.com/samhemelryk/moodle/commit/ecb731cb03ac6569ccd7e48d54bd9c530b7f977e Cheers Mary
          Hide
          John Fitchett added a comment - - edited

          .

          Show
          John Fitchett added a comment - - edited .
          Hide
          Bret Miller added a comment -

          I'm not sure why the priority on this is minor. You would think that editing the front page was basic functionality, and you can't do it if you use My Moodle in 2.0.x, 2.1.x or 2.2.x.

          Show
          Bret Miller added a comment - I'm not sure why the priority on this is minor. You would think that editing the front page was basic functionality, and you can't do it if you use My Moodle in 2.0.x, 2.1.x or 2.2.x.
          Hide
          Ruslan Kabalin added a comment -

          For some reason I can't replicate it on latest MOODLE_22_STABLE...

          Show
          Ruslan Kabalin added a comment - For some reason I can't replicate it on latest MOODLE_22_STABLE...
          Hide
          Bret Miller added a comment -

          Removing 2.2.1. You're right. For some reason, my last test indicated it was an issue, but after testing again this morning, it worked fine. So it's just 2.0.x and 2.1.x that have the issue.

          Show
          Bret Miller added a comment - Removing 2.2.1. You're right. For some reason, my last test indicated it was an issue, but after testing again this morning, it worked fine. So it's just 2.0.x and 2.1.x that have the issue.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Just to point that this seems to be working also OK under current 21_STABLE.

          Only 20_STABLE exhibits the problem, if I'm not wrong.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Just to point that this seems to be working also OK under current 21_STABLE. Only 20_STABLE exhibits the problem, if I'm not wrong. Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Aha, found it. This issue is an exact duplicate of MDL-30569, that fixed the problem for 2.1.x and upwards but was never backported to 2.0.x.

          So, cherry-picking c87fee8510bd0e1662403a698f907f8, should be way to fix the problem for the 2.0.x series.

          Although 2.0 is now out of support, this gets my +1 to be backported. Seems to be safe enough.

          Hope it helps, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Aha, found it. This issue is an exact duplicate of MDL-30569 , that fixed the problem for 2.1.x and upwards but was never backported to 2.0.x. So, cherry-picking c87fee8510bd0e1662403a698f907f8, should be way to fix the problem for the 2.0.x series. Although 2.0 is now out of support, this gets my +1 to be backported. Seems to be safe enough. Hope it helps, ciao
          Hide
          Michael de Raadt added a comment -

          This is now resolved for supported versions.

          Show
          Michael de Raadt added a comment - This is now resolved for supported versions.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: