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

moveto_module() should not modify arguments

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with visible and hidden sections and several modules
      2. Try moving the modules within one section, from one section to another, etc
      3. Make sure the module visibility is changed logically, i.e.:
      • when moving from/to visible section - module visibility does not change
      • when moving from visible to hidden section module becomes hidden, when moving it back it restores the previous value of visibility
      1. Repeat with JS (or AJAX) disabled.

      Please note that there is another bug MDL-41227. So please (in AJAX mode):
      a) ignore the fact that eye icon is not changing if the visibility was changed during the move
      b) refresh page between two consecutive actions (move or change visibility) on the same activity

      Show
      Create a course with visible and hidden sections and several modules Try moving the modules within one section, from one section to another, etc Make sure the module visibility is changed logically, i.e.: when moving from/to visible section - module visibility does not change when moving from visible to hidden section module becomes hidden, when moving it back it restores the previous value of visibility Repeat with JS (or AJAX) disabled. Please note that there is another bug MDL-41227 . So please (in AJAX mode): a) ignore the fact that eye icon is not changing if the visibility was changed during the move b) refresh page between two consecutive actions (move or change visibility) on the same activity
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Epic Link:
    • Pull Master Branch:
      wip-MDL-41181-master

      Description

      At the moment function moveto_module($mod, $section, $beforemod=NULL) may modify the value of $mod->visible . It is only needed for /course/reset.php to serve AJAX requests to move the module.

      First argument may be an instance of cm_info. In MDL-34397 I'm making all properties of cm_info read-only and this function is the only problem.

      Instead moveto_module may return the new value for module visibility.

      Also to mention that modifying JUST $mod->visible is not correct anyway. Other properties such as $mod->uservisible may be affected by this change as well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Rajesh Taneja
              Integrator:
              Dan Poltawski
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13