Problem JS + editor

Hi,

I've a problem with the loading of all the scripts and css : the editor can't be display when i want to add a h5p content.

  1. Steps to recreate the bug : When I add a content with moodle (an example of an url : https://xxxx.fr/course/modedit.php?add=hvp&type=&course=7&section=4&retu...)
  2. Platform you're using: Moodle 3.3 / Ubuntu 16.04.1 / Apache 2 - I've installed plugin using moodle panel administration + moodle.org (not with a zip).
  3. Mobile or Desktop : Desktop
  4. Browser: Chrome, Firefox, Safari etc
  5. H5P plugin version : 1.6
  6. H5P content type version : /
  7. Screenshots if it's a visual problem : ok (=> attachements)

With Firefox (console), I've these errors :

Error loading : « https://xxxx.fr/mod/hvp/library/js/jquery.js?ver=2017112800 ». modedit.php:37
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p.js?ver=2017112800 ». modedit.php:38
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-event-dispatcher.js?ver=2017112800 ». modedit.php:39
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-x-api-event.js?ver=2017112800 ». modedit.php:40
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-x-api.js?ver=2017112800 ». modedit.php:41
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-content-type.js?ver=2017112800 ». modedit.php:42
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-confirmation-dialog.js?ver=201711... ». modedit.php:43
Error loading : « https://xxxx.fr/mod/hvp/library/js/h5p-action-bar.js?ver=2017112800 ». modedit.php:44
Error loading : « https://xxxx.fr/mod/hvp/editor/scripts/h5peditor-editor.js?ver=2017112800 ». modedit.php:45
Error loading : « https://xxxx.fr/mod/hvp/editor/scripts/h5peditor-init.js?ver=2017112800 ». modedit.php:46
Error loading : « https://xxxx.fr/mod/hvp/editor.js?ver=2017112800 ». modedit.php:47
Error loading : « https://xxxx.fr/mod/hvp/editor/language/en.js?ver=2017112800 ». modedit.php:48

If i change/test https://xxxx.fr/ by https://xxxx.fr/www/, the plugin works.

My apache configuration seems ok (DocumentRoot = /var/www/moodle_xxxx.fr/www).

In www/config.php file :

$CFG->wwwroot = "https://xxxx.fr';

$CFG->dataroot = "/var/www/moodle_xxxx.fr/moodledata';

 If anyone have an idea...

Attachments: 
icc's picture

I believe you need to add the following to config.php:

$CFG->httpswwwroot = 'https://xxxx.fr/www/';

Oh,sorry, l'd not tested your fix.

It's ok with your solution too.

Thanks a lot

BV52's picture

Hi llaurent,

I'm glad that it is working for you. If you have any other questions feel free to post in the forums.

-BV52

It's ok now, the problem was DocumentRoot in apache configuration.

Thanks a lot, me, myself and I