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

The function sync_metacourse doesn't sync the hidden field

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.6
    • Fix Version/s: 1.9.8
    • Component/s: Roles / Access
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Let's say we have three courses: A, B and C. Also, course A is a metacourse aggregating B and C.
      Then, i go to course B and enroll a user with any role, marking it as a hidden assign. If i go to course A, the assign o that user will not be hidden.

      I have tracked it down to the sync_metacourse() function, when this function gets the assignments of users in child courses, it doesn't get the hidden field from role_assignments and so, it is not passed as parameter to role_assign() afterwards.

      So, unless this should not be done for some reason, i am willing to do the patch to correct this.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              aborrow Anthony Borrow added a comment -

              Daniel - Here is a quick patch that I think may address your issue. It was true that the hidden field was not being considered when making the assignments. Hidden is not needed for unassignments so give this a test and see if it behaves the way that you need. Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - Daniel - Here is a quick patch that I think may address your issue. It was true that the hidden field was not being considered when making the assignments. Hidden is not needed for unassignments so give this a test and see if it behaves the way that you need. Peace - Anthony
              Hide
              danielneis Daniel Neis Araujo added a comment -

              Hello, Anthony

              thanks for your patch and quick answer. I have tested it here and, as i supposed when i read it, php doesn't allow parameters to be skipped, we have to pass null, or an empty string, or the default value.
              I corrected it and everything worked.
              The uploaded file (MDL-20626v2.patch) is your patch with the corrects.

              Best Regards,
              Daniel

              Show
              danielneis Daniel Neis Araujo added a comment - Hello, Anthony thanks for your patch and quick answer. I have tested it here and, as i supposed when i read it, php doesn't allow parameters to be skipped, we have to pass null, or an empty string, or the default value. I corrected it and everything worked. The uploaded file ( MDL-20626 v2.patch) is your patch with the corrects. Best Regards, Daniel
              Hide
              aborrow Anthony Borrow added a comment -

              Daniel - Thanks for cleaning up the patch. I am glad to hear that it worked. Hopefully we can get this reviewed and checked in. Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - Daniel - Thanks for cleaning up the patch. I am glad to hear that it worked. Hopefully we can get this reviewed and checked in. Peace - Anthony
              Hide
              danielneis Daniel Neis Araujo added a comment -

              Hello, Petr and Eloy

              another simple issue here, if you have time to take a look.

              Thanks.

              Show
              danielneis Daniel Neis Araujo added a comment - Hello, Petr and Eloy another simple issue here, if you have time to take a look. Thanks.
              Show
              ppollet Patrick Pollet added a comment - see http://moodle.org/mod/forum/discuss.php?d=142923#p624133
              Hide
              poltawski Dan Poltawski added a comment -

              Hi Daniel: thanks for the Patch It looks perfect.

              I'm going to apply it once testing day is over.

              Show
              poltawski Dan Poltawski added a comment - Hi Daniel: thanks for the Patch It looks perfect. I'm going to apply it once testing day is over.
              Hide
              poltawski Dan Poltawski added a comment -

              thanks for the patch! I've commited this to CVS

              Show
              poltawski Dan Poltawski added a comment - thanks for the patch! I've commited this to CVS
              Hide
              danielneis Daniel Neis Araujo added a comment -

              Thanks, Dan!

              Show
              danielneis Daniel Neis Araujo added a comment - Thanks, Dan!
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Thanks Daniel, Anthony, Dan!

              Closing as verified... ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Thanks Daniel, Anthony, Dan! Closing as verified... ciao

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Mar/10