Moodle
  1. Moodle
  2. MDL-26131

print_collapsible_region doesn't pass on all of its params

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Libraries
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16141

      Description

      Method print_collapsible_region() does not pass its $default param to print_collapsible_region_start

        Activity

        Hide
        Mark Nielsen added a comment -

        Also discovered that this same method defaults $userpref = '' when it should be $userpref = false in the method definition. Otherwise, print_collapsible_region_start() thinks the $userpref is a valid string and tries to use it.

        Show
        Mark Nielsen added a comment - Also discovered that this same method defaults $userpref = '' when it should be $userpref = false in the method definition. Otherwise, print_collapsible_region_start() thinks the $userpref is a valid string and tries to use it.
        Hide
        Glenn Ansley added a comment -

        Hi Mark,
        I was going to take a stab at this issue as my first patch for Moodle. I see that replacing 'true' with $default will change the default value that print_collapsible_region_start() gets sent (because it comes in as 'false' from print_collabsible_region).

        Should we change the default param in print_collapsible_region() from $default = false to $default = true in order to maintain the previous default value in _start?

        Show
        Glenn Ansley added a comment - Hi Mark, I was going to take a stab at this issue as my first patch for Moodle. I see that replacing 'true' with $default will change the default value that print_collapsible_region_start() gets sent (because it comes in as 'false' from print_collabsible_region). Should we change the default param in print_collapsible_region() from $default = false to $default = true in order to maintain the previous default value in _start?
        Hide
        Glenn Ansley added a comment -

        This is my first attempt and creating a new branch, pushing it back to my fork on github and submitting it as a possible resolution. Suggestions for my process of patching to github and for the actual patch are welcomed!

        https://github.com/glennansley/moodle/tree/MDL-26131

        Show
        Glenn Ansley added a comment - This is my first attempt and creating a new branch, pushing it back to my fork on github and submitting it as a possible resolution. Suggestions for my process of patching to github and for the actual patch are welcomed! https://github.com/glennansley/moodle/tree/MDL-26131
        Hide
        Glenn Ansley added a comment -

        My original changes do not alter the default value for the $default param in print_collapsible_region. This maintains expected behavior for print_collapsible_region but alters expected behavior of print_collapsible_region_start. Commit is here:
        https://github.com/glennansley/moodle/commit/97a6b251b35fe3daea8b883a3c9eda454f42ec29

        To maintain the expected behavior of print_collapsible_region_start() rather than its wrapper function, I changed $default = false to $default = true in this commit:
        https://github.com/glennansley/moodle/commit/97a6b251b35fe3daea8b883a3c9eda454f42ec29

        Show
        Glenn Ansley added a comment - My original changes do not alter the default value for the $default param in print_collapsible_region. This maintains expected behavior for print_collapsible_region but alters expected behavior of print_collapsible_region_start. Commit is here: https://github.com/glennansley/moodle/commit/97a6b251b35fe3daea8b883a3c9eda454f42ec29 To maintain the expected behavior of print_collapsible_region_start() rather than its wrapper function, I changed $default = false to $default = true in this commit: https://github.com/glennansley/moodle/commit/97a6b251b35fe3daea8b883a3c9eda454f42ec29
        Hide
        Petr Škoda added a comment -

        HEllo,
        dix should be available in the next weekly build, thanks a lot for the report and the patches!

        Petr

        Show
        Petr Škoda added a comment - HEllo, dix should be available in the next weekly build, thanks a lot for the report and the patches! Petr
        Hide
        David Mudrak added a comment -

        I came. I tested. I closed.

        Show
        David Mudrak added a comment - I came. I tested. I closed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: