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

Date restrictions conflicts with other date-independent (OR) restrictions if multiple restriction sets are nested

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-76713-401
    • MDL-76713-master
    • Hide

      Tested using Behat. 

      Manual tests (for QA if needed):

      Test 1:

      • Create a course C1
      • In C1 create a Label L1
      • Edit Restrict Access and add the following:
        • Student must match all of the following
          • Student must match the following
            • Student must match all of the following
              • Date until 4 april 2023
              • and
              • Date until 5 april 2023
          • and
          • Date From 4 of April 2023
          • and
          • Date From 3 april 2023
          • and
          • Student must match the following
            • Student must match all of the following
              • Date from 4 april 2023
              • and
              • Date until 11 april 2023
        • Save
        • Edit the label again
        • Change the second date ( until 5the of April)  to from the 6 of april
        • Ensure that there is an error message "Conflict with other date restriction" on the first and second date
        • Change the fourth date from "Date From 3 april 2023" to "Date Until 3rd of April 2023"
        • Ensure that there is an error message "Conflict with other date restriction"  on the fourth date

      Test 2:

      • Create a course C1
      • In C1 create a Label L1
      • Edit Restrict Access and add the following:
        • Student must match of the following
          • Student must match all of the following
            • Date from 4 april 2023
            • and
            • Date until 5 april 2023
          • and
          • Student must match all the following
            • Date from 6 april 2023
            • and
            • Date until 7 april 2023
        • Save
        • Edit the label again
        • Change the second date ( until 5the of April)  to until the 3rd of april
        • Ensure that there is an error message "Conflict with other date restriction" on the first and second date
        • Change the third date to Date from 4 april 2023
        • Change the fourth date to Date until 8 april 2023
        • Ensure that there is an error message "Conflict with other date restriction"  on the fourth date

      Test 3 (non regression on this particular issue):

      • Create a course C1
      • In C1 create a Label L1
      • Edit Restrict Access and add the following:
        • Student must match any of the following
          • Student must match all of the following
            • Date from 4 april 2023
            • and
            • Date until 5 april 2023
          • and
          • Student must match all the following
            • Date from 6 april 2023
            • and
            • Date until 7 april 2023
        • Ensure that there is no related "Conflict with other date restriction" on the first and second date

      This is the screenshot how the issue before the patch with the same configuration. Note that the errors will not appear if the configuration was somewhat saved before successfully (switching between code branches).

      Show
      Tested using Behat.  Manual tests (for QA if needed): Test 1: Create a course C1 In C1 create a Label L1 Edit Restrict Access and add the following: Student must match all of the following Student must match the following Student must match all of the following Date until 4 april 2023 and Date until 5 april 2023 and Date From 4 of April 2023 and Date From 3 april 2023 and Student must match the following Student must match all of the following Date from 4 april 2023 and Date until 11 april 2023 Save Edit the label again Change the second date ( until 5the of April)  to from the 6 of april Ensure that there is an error message "Conflict with other date restriction" on the first and second date Change the fourth date from "Date From 3 april 2023" to "Date Until 3rd of April 2023" Ensure that there is an error message "Conflict with other date restriction"  on the fourth date Test 2: Create a course C1 In C1 create a Label L1 Edit Restrict Access and add the following: Student must match of the following Student must match all of the following Date from 4 april 2023 and Date until 5 april 2023 and Student must match all the following Date from 6 april 2023 and Date until 7 april 2023 Save Edit the label again Change the second date ( until 5the of April)  to until the 3rd of april Ensure that there is an error message "Conflict with other date restriction" on the first and second date Change the third date to Date from 4 april 2023 Change the fourth date to Date until 8 april 2023 Ensure that there is an error message "Conflict with other date restriction"  on the fourth date Test 3 (non regression on this particular issue): Create a course C1 In C1 create a Label L1 Edit Restrict Access and add the following: Student must match any of the following Student must match all of the following Date from 4 april 2023 and Date until 5 april 2023 and Student must match all the following Date from 6 april 2023 and Date until 7 april 2023 Ensure that there is no related "Conflict with other date restriction" on the first and second date This is the screenshot how the issue before the patch with the same configuration. Note that the errors will not appear if the configuration was somewhat saved before successfully (switching between code branches).
    • 3
    • HQ 2023 Planning i2 Moppies

      Hello,

      we have detected a possible bug in the activity module date restrictions settings. When setting two sets of valid date restrictions, a warning is displayed stating "Conflicts with other date restrictions". The conflict doesn't seem to be there.

      We have tested this in both Moodle 3.11.11 and 4.1. It can be replicated by following the steps below:

      1. Create an empty course.
      2. Create an activity (quiz, for example) and set date restrictions as follows:
        • Add a restriction set.
        • Within the previous set, add two new separate sets.
        • Within the last two sets, add, in each set, two date restrictions and configure them as shown in the screenshots (group restriction are optional).
        • Add a grade restriction on the first level as show in the screenshots.
          • This is not really necessary to reproduce the problem, it is just to make sense of the first level of conditions, otherwise it might seem redundant. This is the way, in the actual use case, we have detected the error.

      Expected: should not show the date conflict warning.
      What happens: shows date conflict between two dates that should be independent.

      I have created a post in the moodle forum about this: https://moodle.org/mod/forum/discuss.php?d=441498 

      It could be related to this issue: https://tracker.moodle.org/browse/MDL-72490

      Regards

       

       

        1. (1) Passed -- (Master)MDL-76713.png
          (1) Passed -- (Master)MDL-76713.png
          52 kB
        2. (2) Passed -- (Master)MDL-76713.png
          (2) Passed -- (Master)MDL-76713.png
          38 kB
        3. (3) Passed -- (Master)MDL-76713.png
          (3) Passed -- (Master)MDL-76713.png
          25 kB
        4. image-2023-08-07-10-27-17-314.png
          image-2023-08-07-10-27-17-314.png
          76 kB
        5. MDL-76713_Test 1_1.png
          MDL-76713_Test 1_1.png
          83 kB
        6. MDL-76713_Test 1_2.png
          MDL-76713_Test 1_2.png
          82 kB
        7. MDL-76713_Test 2_1.png
          MDL-76713_Test 2_1.png
          80 kB
        8. MDL-76713_Test 2_2.png
          MDL-76713_Test 2_2.png
          74 kB
        9. MDL-76713_Test 3.png
          MDL-76713_Test 3.png
          87 kB
        10. MDL-76713.mp4
          2.91 MB
        11. MDL-76713- 401 (1).png
          MDL-76713- 401 (1).png
          503 kB
        12. MDL-76713-quiz-restrictions.png
          MDL-76713-quiz-restrictions.png
          39 kB
        13. MDL-76713-quiz-restrictions-2.png
          MDL-76713-quiz-restrictions-2.png
          44 kB

            laurent.david@moodle.com Laurent David
            jmabreu Miguel_
            Ferran Recio Ferran Recio
            Amaia Anabitarte Amaia Anabitarte
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            10 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 day, 4 hours, 33 minutes
                1w 1d 4h 33m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.