Uploaded image for project: 'H5P'
  1. HFP-1103

PHP warning when installing and registering with H5P.org fails

    Details

    • Type: Bug
    • Status: Done (View workflow)
    • Priority: Highest
    • Resolution: Done
    • Affects versions: None
    • Fix versions: Mani
    • Labels:
      None
    • Sprint:
    • Released:
      Released
    • Acceptance Criteria:
      Hide
      - Make it possible to call fetchLibrariesMetadata as a function not part of an AJAX.
      - Answer forum post at https://h5p.org/comment/12642#comment-12642
      Show
      - Make it possible to call fetchLibrariesMetadata as a function not part of an AJAX. - Answer forum post at https://h5p.org/comment/12642#comment-12642

      Description

      Getting "Got error 'PHP message: PHP Warning: Cannot modify header information - headers already sent by (output started at /data/sites/anako/moodle/lib/upgradelib.php:1400) in /data/sites/anako/moodle/mod/hvp/library/h5p.classes.php on line 2784"
      when installing a new install of Moodle. Since this is core functionality it can probabaly be experienced in the other integrations as well.
      The problem is that fetchLibrariesMetadata assumes that it is called as an AJAX, so it is trying to set headers of the request, but in this instance the function is just called as a function from the install script. When the site fails registering the site with H5P.org it throws an ajax error, which sets headers, which is not allowed.

        Attachments

          Activity

            People

            • Assignee:
              thomasmars Thomas Marstrander
              Reporter:
              thomasmars Thomas Marstrander
              Code reviewer:
              Pål Jørgensen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 6h
                6h
                Remaining:
                Remaining Estimate - 6h
                6h
                Logged:
                Time Spent - Not Specified
                Not Specified