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

Calendar month block previous/next links broken on non course pages

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.3.4, 2.4.1
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Calendar
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      Test pre-requisites

      • Move the calendar block to the left pane
      • Set the calendar block to be displayed throughout the site

      Test 1

      1. Log in as an admin
      2. Browse to your profile (outside a course)
      3. Make sure the next/previous navigation works on the calendar block, without redirecting you to another page
      4. Navigate to a site page not ending with view.php (ie. the tags page)
      5. Make sure the next/previous navigation works on the calendar block, without redirecting you to another page
      6. Navigate to another set of pages and make sure the next/previous navigation works on the calendar block, without redirecting you to another page

      Test 2

      1. Navigate to a course
      2. Make sure the next/previous navigation works on the calendar block, without redirecting you to another page
      3. Navigate to a sub page which does not end with view.php (ie. enrolment page)
      4. Make sure the next/previous navigation works on the calendar block, without redirecting you to another page
      5. Explore some other pages and make sure the next/previous navigation works on the calendar block, without redirecting you to another page
      Show
      Test pre-requisites Move the calendar block to the left pane Set the calendar block to be displayed throughout the site Test 1 Log in as an admin Browse to your profile (outside a course) Make sure the next/previous navigation works on the calendar block, without redirecting you to another page Navigate to a site page not ending with view.php (ie. the tags page) Make sure the next/previous navigation works on the calendar block, without redirecting you to another page Navigate to another set of pages and make sure the next/previous navigation works on the calendar block, without redirecting you to another page Test 2 Navigate to a course Make sure the next/previous navigation works on the calendar block, without redirecting you to another page Navigate to a sub page which does not end with view.php (ie. enrolment page) Make sure the next/previous navigation works on the calendar block, without redirecting you to another page Explore some other pages and make sure the next/previous navigation works on the calendar block, without redirecting you to another page
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25853-master

      Description

      On non-course pages the previous/next links are completely broken. It should probably use the new page url stuff, but calendar is a bit spagettiish, so will take some unpicking to sort out.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            howardsmiller Howard Miller added a comment -

            This is still broken in 2.0.3.

            The problem seems to be that the only thing passed to the 'calendar_top_controls' function is the course id number. This doesn't help if the block is not on a course page.

            Show
            howardsmiller Howard Miller added a comment - This is still broken in 2.0.3. The problem seems to be that the only thing passed to the 'calendar_top_controls' function is the course id number. This doesn't help if the block is not on a course page.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Confirmed this issue still affects Moodle (2.4).

            Debug info: SELECT * FROM

            Unknown macro: {course}

            WHERE id = ?
            [array (
            0 => 0,
            )]
            Error code: invalidrecord
            Stack trace:

            line 1357 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
            line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
            line 43 of /user/index.php: call to moodle_database->get_record()

            Priority raised and marking as triaged. See testing instructions if you want to replicate.

            Show
            samhemelryk Sam Hemelryk added a comment - Confirmed this issue still affects Moodle (2.4). Debug info: SELECT * FROM Unknown macro: {course} WHERE id = ? [array ( 0 => 0, )] Error code: invalidrecord Stack trace: line 1357 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select() line 43 of /user/index.php: call to moodle_database->get_record() Priority raised and marking as triaged. See testing instructions if you want to replicate.
            Hide
            fred Frédéric Massart added a comment -

            Note: I am also fixing a problem when navigating in a course, on pages which don't end with 'view.php'.

            Show
            fred Frédéric Massart added a comment - Note: I am also fixing a problem when navigating in a course, on pages which don't end with 'view.php'.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Hi Fred,
            Just summarising our discussion here. The patch works efficiently for most cases, except the ones where you are in the middle of making a post kind of thing (example backup). So if you are on step 2 of backup and click next/prev it takes you back to the first page. But there is nothing really much we can do about it.

            The patch looks good, feel free to submit for integration.

            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Hi Fred, Just summarising our discussion here. The patch works efficiently for most cases, except the ones where you are in the middle of making a post kind of thing (example backup). So if you are on step 2 of backup and click next/prev it takes you back to the first page. But there is nothing really much we can do about it. The patch looks good, feel free to submit for integration. Thanks
            Hide
            fred Frédéric Massart added a comment -

            Thanks Ankit!

            Indeed, that could have been an issue and that's why I decided to rely on $PAGE->url which is set by the developer for each page. As you discovered it, it wouldn't crash in the middle of a post process but go back to the beginning (or wherever the developer decides to) which sounds good enough to me.

            Pushing for integration.

            Show
            fred Frédéric Massart added a comment - Thanks Ankit! Indeed, that could have been an issue and that's why I decided to rely on $PAGE->url which is set by the developer for each page. As you discovered it, it wouldn't crash in the middle of a post process but go back to the beginning (or wherever the developer decides to) which sounds good enough to me. Pushing for integration.
            Hide
            poltawski Dan Poltawski added a comment -

            Integrated to master, 24 and 23. Thanks Fred.

            Show
            poltawski Dan Poltawski added a comment - Integrated to master, 24 and 23. Thanks Fred.
            Hide
            markn Mark Nelson added a comment -

            Works as expected. Awesome work Fred, I am really proud of you mate sheds tear. Passing.

            Show
            markn Mark Nelson added a comment - Works as expected. Awesome work Fred, I am really proud of you mate sheds tear . Passing.
            Hide
            damyon Damyon Wiese added a comment -

            Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone!

            Regards, Damyon

            Show
            damyon Damyon Wiese added a comment - Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone! Regards, Damyon

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13