Moodle
  1. Moodle
  2. MDL-20994

'Blocks editing on' in live logs throws error message

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Unknown
    • Labels:
      None
    • URL:
      /course/report/log/indexlive.php?section=reportloglive&adminedit=on
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Full steps to reproduce:

      1. Add 'System administration' block to the front page.
      2. Click Reports -> Live logs
      3. On the live logs page, click 'Blocks editing on' on the top right
      4. Following error message is displayed: "That's an invalid course id0"

      What was expected:

      • No Error message

      What actually happens:

      • Errror message: "That's an invalid course id0"

        Gliffy Diagrams

        1. indexlive.patch
          0.7 kB
          Andrew Davis
        2. indexlive2.patch
          1 kB
          Andrew Davis

          Activity

          Hide
          Andrew Davis added a comment -

          Attaching patch to /course/report/log/indexlive.php

          When turning on block editing course id was defaulting to 0 rather than SITEID meaning it wouldn't work outside of the context of a course without having an id url parameter passed in.

          Waiting for a review before I commit this.

          Show
          Andrew Davis added a comment - Attaching patch to /course/report/log/indexlive.php When turning on block editing course id was defaulting to 0 rather than SITEID meaning it wouldn't work outside of the context of a course without having an id url parameter passed in. Waiting for a review before I commit this.
          Hide
          Tim Hunt added a comment -

          Actually, the optional_param line you changed should be required_param with no default.

          Then, the real cause of this bug is that $PAGE->url is not getting set correctly, so we cannot construct the right URL for the blocks_editing_on action.

          See the commit in the version control tab of MDL-10047 - that is where I fixed a lot of instances of this bug in other places - but I did not find them all.

          Show
          Tim Hunt added a comment - Actually, the optional_param line you changed should be required_param with no default. Then, the real cause of this bug is that $PAGE->url is not getting set correctly, so we cannot construct the right URL for the blocks_editing_on action. See the commit in the version control tab of MDL-10047 - that is where I fixed a lot of instances of this bug in other places - but I did not find them all.
          Hide
          Andrew Davis added a comment - - edited

          I've attached my second attempt indexlive2.patch

          Show
          Andrew Davis added a comment - - edited I've attached my second attempt indexlive2.patch
          Hide
          Andrew Davis added a comment -

          Committed to the 1.9 branch. Trunk (version 2) seems to be working fine.

          Show
          Andrew Davis added a comment - Committed to the 1.9 branch. Trunk (version 2) seems to be working fine.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: