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

Duplicating a hidden resource can cause both to become unhidden

    Details

    • Testing Instructions:
      Hide
      1. Run unit tests
      2. Create an url resource and set it to hidden in the moodle form
      3. Duplicate the newly created url with the x2 icon
      4. Save and return to course
      5. VERIFY: that both modules are hidden.
      6. Add three resources into a single section
      7. Hide 2 of them
      8. Hide the section
      9. VERIFY that all resources are hidden
      10. Unhide the section
      11. VERIFY that the same two resources are hidden as above and the other one is unhidden
      12. Hide a section with no resources in it
      13. Move an unhidden resource tot hat section
      14. VERIFY: the resource is hidden
      15. Move the resource into a visible section
      16. VERIFY: the resource is visible
      Show
      Run unit tests Create an url resource and set it to hidden in the moodle form Duplicate the newly created url with the x2 icon Save and return to course VERIFY: that both modules are hidden. Add three resources into a single section Hide 2 of them Hide the section VERIFY that all resources are hidden Unhide the section VERIFY that the same two resources are hidden as above and the other one is unhidden Hide a section with no resources in it Move an unhidden resource tot hat section VERIFY: the resource is hidden Move the resource into a visible section VERIFY: the resource is visible
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      MDL-38700-master

      Description

      When duplicating a hidden module within a visible section both the module and its duplicate become unhidden. Steps to reproduce 2.3:

      1. Hide an item with the eyeball icon or create it as hidden
      2. Duplicate it with the x2 icon
      3. Save and return to course
      4. Refresh the course page

      Steps to reproduce in 2.4 and current master:

      1. Create an item as hidden
      2. Duplicate it with the x2 icon
      3. Save and return to course
      4. Refresh the course page

      Both modules are now visible. I believe this is a regression introduced by MDL-37430, which didn't take into account that moveto_module() is called by modduplicate.php.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  18 Vote for this issue
                  Watchers:
                  10 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/May/13