PHP warning when installing and registering with H5P.org fails

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.

Environment

None

Acceptance Criteria

Activity

Show:
Pål Jørgensen
May 24, 2017, 11:01 AM

Fix is looking good!

Thomas Marstrander
May 22, 2017, 11:40 AM

Fixed, and answered forum. This error should however only have caused some error messages, not fail the entire installation, so I have asked the user if about this, maybe they have some additional problems.

Svein-Tore Griff With
May 16, 2017, 9:57 AM

An experienced Moodle team is unable to install H5P. I'm prioritizing this as a blocker. We release the fix along with other Moodle updates early next week.

Done

Assignee

Thomas Marstrander

Reporter

Thomas Marstrander

Code reviewer

Pål Jørgensen

Released

Released

Time tracking

0m

Time remaining

6h

Fix versions