Moodle
  1. Moodle
  2. MDL-42795

get_format_options function uses wrong columnname

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5.2, 2.6
    • Fix Version/s: 2.4.8, 2.5.4
    • Component/s: Course
    • Labels:
    • Rank:
      54660

      Description

      The get_format_options function of the course format library refers to the column 'courseid'. However this column does not exist in the table course_sections. It should be 'course'.

      course/format/lib.php line 575
      --array('section' => $section, 'courseid' => $this->courseid), 'id')))
      ++array('section' => $section, 'course' => $this->courseid), 'id')))
      

      Additional course formats like grid and masonry depend heavily on this function.

        Activity

        Hide
        Marina Glancy added a comment -

        Hi Renaat, thanks very much for reporting this bug. It does not occur in core because neither of standard course formats have section format options. But it definitely can affect 3rd party coruse formats. Do you want to submit your patch as github branch to have credits for it?

        Show
        Marina Glancy added a comment - Hi Renaat, thanks very much for reporting this bug. It does not occur in core because neither of standard course formats have section format options. But it definitely can affect 3rd party coruse formats. Do you want to submit your patch as github branch to have credits for it?
        Hide
        Marina Glancy added a comment -

        I'm marking it as must fix because in 2.4 and 2.5 this bug does not cause fatal errors and in 2.6 it does.

        Show
        Marina Glancy added a comment - I'm marking it as must fix because in 2.4 and 2.5 this bug does not cause fatal errors and in 2.6 it does.
        Hide
        Rajesh Taneja added a comment -

        Thanks Renaat and Marina,

        I am taking this issue as it's Must Fix and can't wait longer.
        Will create branch and give credits to Renaat.

        Show
        Rajesh Taneja added a comment - Thanks Renaat and Marina, I am taking this issue as it's Must Fix and can't wait longer. Will create branch and give credits to Renaat.
        Hide
        Marina Glancy added a comment -

        Thanks Raj, I suppose the testing instruction will be to try installing on 2.6 any format plugin that uses sections - grid, masonry or flexsections

        Show
        Marina Glancy added a comment - Thanks Raj, I suppose the testing instruction will be to try installing on 2.6 any format plugin that uses sections - grid, masonry or flexsections
        Hide
        Rajesh Taneja added a comment -

        Thanks Marina,

        Theme flexsections and masonry are giving lot of debugging errors for section_info, so not sure if that should be part of testing instructions.

        Show
        Rajesh Taneja added a comment - Thanks Marina, Theme flexsections and masonry are giving lot of debugging errors for section_info, so not sure if that should be part of testing instructions.
        Hide
        Marina Glancy added a comment -

        the fix is obviously fine

        Raj, can you add branches for 2.4 and 2.5, it must be fixed there as well even it's hard to test there

        Show
        Marina Glancy added a comment - the fix is obviously fine Raj, can you add branches for 2.4 and 2.5, it must be fixed there as well even it's hard to test there
        Hide
        Rajesh Taneja added a comment -

        Thanks Marina,

        Created 25 and 24 branches, pushing for integration.

        Show
        Rajesh Taneja added a comment - Thanks Marina, Created 25 and 24 branches, pushing for integration.
        Hide
        Sam Hemelryk added a comment -

        Thanks guys, this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks guys, this has been integrated now.
        Hide
        Sam Hemelryk added a comment -

        Tested and passed thanks guys.

        Show
        Sam Hemelryk added a comment - Tested and passed thanks guys.
        Hide
        Renaat Debleu added a comment -

        Thanks all! Now I can fix the additional course format updates. Indeed, the masonry course format will need some heavy work before the 2.6 release.

        Show
        Renaat Debleu added a comment - Thanks all! Now I can fix the additional course format updates. Indeed, the masonry course format will need some heavy work before the 2.6 release.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        It's Friday, I'm tired so I won't be very imaginative today.

        No matter of that, yes, you did it! Thanks for your collaboration!

        Closing this as fixed!

        Show
        Eloy Lafuente (stronk7) added a comment - It's Friday, I'm tired so I won't be very imaginative today. No matter of that, yes, you did it! Thanks for your collaboration! Closing this as fixed!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: