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

Group availability conditions broken after restore without groups

    XMLWordPrintable

Details

    • Bug
    • Status: Development in progress
    • Minor
    • Resolution: Unresolved
    • 3.11.4
    • None

    Description

      If you restore an activity with the following availability conditions without also restoring groups you end up with the error Invalid availability structure (->c, ->showc mismatch) which renders the course unusable.

      • date
      • group
      • group

      Availability condition of original acitivity:

      {"op":"&","c":[{"type":"date","d":">=","t":1637881200},{"type":"group","id":3589},{"type":"group","id":3590}],"showc":[true,true,true]}
      

      Availability condition of restored activity:

      {"op":"&","showc":[true,true],"c":[{"type":"date","d":">=","t":1637881200}]}
      

      Cause of the bug is this line: https://github.com/moodle/moodle/blob/18b2af60f5de26a3826fdf12584b073cf1c8eed0/availability/classes/tree.php#L687

      Attachments

        Activity

          People

            tschroeder Tim Schroeder
            tschroeder Tim Schroeder
            Sam Marshall Sam Marshall
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: