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

pre_enable_plugin_actions should be checked from core\pluginfo\mod, not the endpoint

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77248-401
    • MDL-77248-master
    • Hide

      test setup

      1. Open a connection to your database and cleaer any existing value for the dpa setting:

        delete from mdl_config where name = 'bigbluebuttonbn_default_dpa_accepted';
        

      2. Purge caches

        php admin/cli/purge_caches.php
        

      h3 Test

      1. Login as admin
      2. Navigate to Site admin -> Plugins -> Manage activities
      3. Try to click the "Enable" button for bigbluebutton
        1. Confirm that you are redirected to the same page
        2. Confirm that you are shown a notification at the top of the page that yo umust complete the data processing agreement
        3. Confirm that BBB was not enabled
        4. Confirm that the URL ends in /admin/modules.php and does not contain nay extra parameters (like sesskey)
      4. Follow the link in the "confirm that you have read..." text
      5. Agree to the agreement and save changes
      6. Go back to the Management page
      7. Click the "Enable" link again
        1. Confirm that you did not get a notification
        2. Confirm that the plugin was enabled
      Show
      test setup Open a connection to your database and cleaer any existing value for the dpa setting: delete from mdl_config where name = 'bigbluebuttonbn_default_dpa_accepted'; Purge caches php admin/cli/purge_caches.php h3 Test Login as admin Navigate to Site admin -> Plugins -> Manage activities Try to click the "Enable" button for bigbluebutton Confirm that you are redirected to the same page Confirm that you are shown a notification at the top of the page that yo umust complete the data processing agreement Confirm that BBB was not enabled Confirm that the URL ends in /admin/modules.php and does not contain nay extra parameters (like sesskey) Follow the link in the "confirm that you have read..." text Agree to the agreement and save changes Go back to the Management page Click the "Enable" link again Confirm that you did not get a notification Confirm that the plugin was enabled

      The pre_enable_plugin_actions callback was introduced in MDL-74584 but was added to admin/modules.php - which is the endpoint used to control the UI. This is wrong.

      This should have been added to lib/classes/plugininfo/mod.php in the enable_plugin function.

      With this in the wrong place, it is possible to enable plugins which should not be enabled.

      As a case-in-point, all of the bigbluebutton unit tests fail when this is moved to the correct place because the dpa policy is not agreed to.

        1. 400.gif
          400.gif
          1.94 MB
        2. 400.png
          400.png
          145 kB
        3. 401.gif
          401.gif
          2.38 MB
        4. 401.png
          401.png
          180 kB
        5. master.gif
          master.gif
          1.36 MB
        6. master.png
          master.png
          142 kB
        7. Screenshot 2023-02-28 at 12.07.22.png
          Screenshot 2023-02-28 at 12.07.22.png
          168 kB

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Laurent DAVID Laurent DAVID
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 48 minutes
                4h 48m

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