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

Warning can be generated by H5P when it generates a plugin file url

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.11.8, 4.0.2
    • None
    • H5P
    • MOODLE_311_STABLE, MOODLE_400_STABLE

    Description

      I have seen that h5p is occasionally generating warnings in our logs:

      E_WARNING: array_search() expects parameter 2 to be array, bool given
      in array_search called at /var/www/html/h5p/classes/api.php (320)
      in core_h5p\api::create_content_from_pluginfile_url called at /var/www/html/h5p/classes/player.php (130)
      in core_h5p\player::__construct called at /var/www/html/contentbank/contenttype/h5p/classes/content.php (52)
      in contenttype_h5p\content::is_view_allowed called at /var/www/html/contentbank/classes/contentbank.php (219)
      in core_contentbank\contentbank::search_contents called at /var/www/html/contentbank/index.php (65)
      

      it appears to be happening because the code does not take into account that the helper can set the info property to false if there are no messages

      It looks as though the same issue is currently present in master

      Attachments

        Activity

          People

            Unassigned Unassigned
            nmagill Neill Magill
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: