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

When H5P is enabled or disabled in admin/searcharea.php exception is thrown

    XMLWordPrintable

Details

    • MOODLE_311_STABLE
    • MOODLE_311_STABLE
    • MDL-74307-311
    • MDL-74307-master
    • Hide

      Prerequisites

      1. Login as admin
      2. Create a course and add H5P activity to the course. Lets name the activity as 'H5P test'.
      3. Enable global search in 'Advanced features' in the Site administration.

      Steps to test

      1. Go to Site administration > Plugins > Search > Manage global search.
        Make sure the search engine is set to 'Simple search'.
      2. Go to Site administration > Plugins > Search > Search areas and click on 'Update indexed contents' button.
      3. In the search box of the page (i.e, the search in the same row where the notification button is seen at the top right of the page) type activity name 'H5P'.
      4. The activity 'H5P test' should be listed in the search.
      5. Now go to Site administration > Plugins > Search > Search areas and disable the H5P activity, by clicking in the Enable column.
      6. Now search activity name 'H5P' same as in step 3.
      7. The user should not see any exception. Also 'H5P test' should not be listed.
      Show
      Prerequisites Login as admin Create a course and add H5P activity to the course. Lets name the activity as 'H5P test'. Enable global search in 'Advanced features' in the Site administration. Steps to test Go to Site administration > Plugins > Search > Manage global search. Make sure the search engine is set to 'Simple search'. Go to Site administration > Plugins > Search > Search areas and click on 'Update indexed contents' button. In the search box of the page (i.e, the search in the same row where the notification button is seen at the top right of the page) type activity name 'H5P'. The activity 'H5P test' should be listed in the search. Now go to Site administration > Plugins > Search > Search areas and disable the H5P activity, by clicking in the Enable column. Now search activity name 'H5P' same as in step 3. The user should not see any exception. Also 'H5P test' should not be listed.
    • 1
    • QA time

    Description

      This issue was spotted while testing MDLQA-16531.

      For instance when the user had enabled H5P activity and is executing step 6

      "Go back to 'Search areas' and disable the search area for the activity."

      When user disables H5P activity in searcharea.php the $areaid receives trimmed value. Meaning instead of 'mod_h5pactivity' it gets 'mod_hpactivity' this is causing exception at:

      $area = \core_search\manager::get_search_area($areaid);

      If we use type for optional_param as PARAM_ALPHANUMEXT then it would be better and no exception would be thrown.

      Attachments

        1. MDL-74307_master_1.png
          MDL-74307_master_1.png
          63 kB
        2. MDL-74307_master_2.png
          MDL-74307_master_2.png
          59 kB
        3. MDL-74307_v311_1.png
          MDL-74307_v311_1.png
          60 kB
        4. MDL-74307_v311_2.png
          MDL-74307_v311_2.png
          56 kB

        Issue Links

          Activity

            People

              sujith Sujith Haridasan
              sujith Sujith Haridasan
              Ferran Recio Ferran Recio
              Victor Déniz Falcón Victor Déniz Falcón
              Angelia Dela Cruz Angelia Dela Cruz
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/May/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 15 minutes
                  1h 15m