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

H5P - Error occurs while delete an empty course with existing content bank

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.11.6
    • H5P
    • MOODLE_311_STABLE
    • Hide

      Create a course (C1).

      1. Upload an new content in the course content bank (for example https://h5p.org/presentation)
      2. Delete the course
      3. The course should be deleted without error

       

      Show
      Create a course (C1). Upload an new content in the course content bank (for example https://h5p.org/presentation) Delete the course The course should be deleted without error  

      When a H5P activity with attached files is uploaded in a content bank and then the course is deleted, the following error is displayed:

      Moodle 3.11.6+ (Build: 20220315), PHP 7.3

      This error occurs while delete an empty course:

      H5P-Datei nicht gefunden (ungültige Kontext-ID)Error code: invalidcontextid
      ×Stack trace: 
      line 512 of /h5p/classes/api.php: moodle_exception thrown
      line 359 of /h5p/classes/api.php: call to core_h5p\api::get_pluginfile_hash()
      line 53 of /contentbank/contenttype/h5p/classes/contenttype.php: call to core_h5p\api::delete_content_from_pluginfile_url()
      line 271 of /contentbank/classes/contentbank.php: call to contenttype_h5p\contenttype->delete_content()
      line 5209 of /lib/moodlelib.php: call to core_contentbank\contentbank->delete_contents()
      line 5011 of /lib/moodlelib.php: call to remove_course_contents()
      line 68 of /course/delete.php: call to delete_course()

       
      This was the single record in table of contenbank_content:{{}}
      id name contenttype contextid visibility instanceid configdata usercreated usermodified timecreated timemodified
      1 dreisatz-aufgaben-verschiedene-16.h5p contenttype_h5p 373 1 0 2 2 1605825791 1605825829

      full pluginfile $url was: https://.....de/pluginfile.php?file=/373/contentbank/public/1/dreisatz-aufgaben-verschiedene-16.h5p

       

      h5p/classes/api.php => in function get_pluginfile_hash()

      With this URL as a parameter, the first lines of code in this get_pluginfile_hash() function don't seem to get the correct slasharguments - the $parts and $path variables are incorrect or empty. From this reason the invalidcontextid error occurs.

      We're not sure - could this be a bug?

       

       

       

       

            Unassigned Unassigned
            hansen Rene Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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