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

print_collapsible_region doesn't pass on all of its params

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      Description

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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bushido 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
            bushido 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
            blepoxp 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
            blepoxp 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
            blepoxp 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
            blepoxp 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
            blepoxp 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
            blepoxp 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
            skodak Petr Skoda added a comment -

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

            Petr

            Show
            skodak Petr Skoda added a comment - HEllo, dix should be available in the next weekly build, thanks a lot for the report and the patches! Petr
            Hide
            mudrd8mz David Mudrák added a comment -

            I came. I tested. I closed.

            Show
            mudrd8mz David Mudrák 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:
                  Fix Release Date:
                  21/Feb/11