We're updating the issue view to help you get more done. 

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

Status

Assignee

Thomas Marstrander

Reporter

Thomas Marstrander

Labels

None

Funding

None

Code reviewer

Pål Jørgensen

Released

Released

Time tracking

6h

Fix versions

Priority

Highest