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

Conditional availability: Missing lang string for save settings error

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_27_STABLE
    • MDL-45550-master
    • Hide

      0. Enable availability in site settings if required.
      1. Create a new Page activity.
      2. Under 'Restrict access', set a Date condition and a Profile condition (doesn't matter what the values are).
      3. Save and return to course.
      EXPECTED (as before): Both conditions are listed on the page while editing.
      4. Go to Site administration / Plugins / Availability restrictions / Manage restrictions.
      5. Click the eye icon for restriction by profile.
      6. Go back to the course page and reload.
      EXPECTED: Only the date condition is shown on the page.
      7. Edit the activity settings and expand 'Restrict access'.
      EXPECTED: The profile condition shows as 'Missing restriction plugin' with a 'Please set' indicator.
      8.Save and return to course.
      EXPECTED: Form validation fails and the form reloads. A suitable error message appears by the 'Access restrictions' label.
      9. Click the X button next to the 'Missing restriction plugin' box.
      10. Save and return to course.
      EXPECTED: Saves successfully.

      Show
      0. Enable availability in site settings if required. 1. Create a new Page activity. 2. Under 'Restrict access', set a Date condition and a Profile condition (doesn't matter what the values are). 3. Save and return to course. EXPECTED (as before): Both conditions are listed on the page while editing. 4. Go to Site administration / Plugins / Availability restrictions / Manage restrictions. 5. Click the eye icon for restriction by profile. 6. Go back to the course page and reload. EXPECTED: Only the date condition is shown on the page. 7. Edit the activity settings and expand 'Restrict access'. EXPECTED: The profile condition shows as 'Missing restriction plugin' with a 'Please set' indicator. 8.Save and return to course. EXPECTED: Form validation fails and the form reloads. A suitable error message appears by the 'Access restrictions' label. 9. Click the X button next to the 'Missing restriction plugin' box. 10. Save and return to course. EXPECTED: Saves successfully.

      The situation when a availability plugin which is already in use, is disabled, is not properly handled by core.
      There are two aspects to this,
      1) The implementation of the condition - It seems a decision was made at some point to silently ignore these restrictions.
      We have the following comment in tree::construct()

           * 2. Data that meets the structure but cannot be implemented (e.g.
           *    reference to missing plugin or to module that doesn't exist) is
           *    either silently discarded (if $lax is true) or causes a
           *    coding_exception (if $lax is false).
      

      2) The edit module UI.
      In the UI the condition appears as "Missing restriction plugin", however when you try to save the activity it comes up with an error "[[item_unknowntype]]"

            quen Sam Marshall
            ankit_frenz Ankit Agarwal
            Ankit Agarwal Ankit Agarwal
            Dan Poltawski Dan Poltawski
            Mark Nelson Mark Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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