H5P plug-in, the editor loads only if the language setting is English

H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Number of replies: 17
Particularly helpful Moodlers的相片 Translators的相片

I can reproduce this in Moodle 3.9.3+, mod_hvp 1.21.1 2020082800, theme Eguru v3.9 2020073000, PHP 7.4.3 Debian.

When I start creating a new H5P activity, the editor won't load, if the selected language in Moodle is German. Once I change to English, the editor appears. (see attached screen shots).

Tested with Firefox and Brave browsers, both latest, Debian Linux.

It has been working previously on Moodle 3.5, PHP 7.0. This started after I upgraded the whole OS and Moodle.


評比平均分數: -
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Same behaviour with Boost.

The effect of the language setting is direct. I can be on the blocked German page. When I switch the language in the drop-doen to English the editor loads!
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Further update. With debugging at DEVELOPER the following errors were sent to the logs:

[Mon Jan 04 20:03:10.451016 2021] [php7:notice] [pid 78253] [client x.x.x.x:37850] Default exception handler: Coding error detected, it must be fixed by a programmer: Unhandled AJAX Debug: \nError code: codingerror\n* line 343 of /mod/hvp/ajax.php: coding_exception thrown\n, referer: https://moodle.example.com/course/modedit.php?sr=0&add=hvp&section=1&course=857&lang=en
[Mon Jan 04 20:03:20.400282 2021] [php7:notice] [pid 78225] [client x.x.x.x:37854] Default exception handler: Fehler in der Kodierung gefunden, den nur Programmierer/innen korrigieren k\xc3\xb6nnen: Unhandled AJAX Debug: \nError code: codingerror\n* line 343 of /mod/hvp/ajax.php: coding_exception thrown\n, referer: https://moodle.example.com/course/modedit.php?sr=0&add=hvp&section=1&course=857&lang=de

The whole file ajax.php is one big 'switch'
===
$action = required_param('action', PARAM_ALPHA);
switch($action) {
   case 'contentsuserdata':
   //many other case statements
===
But the control enters the 'default'. So it must be 'course/modedit.php?sr=0&add=hvp&section=1&course=857&lang=en' breaking something.
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Daniel Thies發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

Hello Visvanth,

I barely remember having same problem a few months back. I seem to remember there being an issue with the scheduled task which updated the content types. Some content types had an incomplete download that had a corrupted file in storage and the task failed each time. You might try running that manually with debugging to see if there is an issue there.

Daniel

In reply to Daniel Thies

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi Daniel

That sounds promising. But task logs brought nothing:


Then I went through > Site administration > Plugins > Activity modules > H5P > H5P Libraries and noticed that the installed library Column (1.8.4) needs upgrading. When I do that, I get the following error.

t
The odd thing is, it finally says "You have successfully upgraded 14 content instance(s). Return"
In case that is related.
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Daniel Thies發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

Yes, this is familiar. I do not think that it is loading a development version. I do not think the task is failing, but it should show an warning or error in the trace messages if you run on command line.

Before, you go any farther make a database and dataroot backup and save as evidence because this is not easy to reproduce and they may be helpful for question for making a bug report. (I did not do this and regretted it)..

What I think is happening is that the file download is validated at the wrong point. A corrupt file is downloaded and saved. This fails a validation step which gives the above error. There is a an entry added to the filearea in the files table. The code really should be saving the file in a draft area, then validating it. and then move it to the permanent file area when it checks out.

Anyway what worked for me was deleting the entry from the files table corresponding to that content type, and rerunning the script to download it again. (remember to save the backup first)

評比平均分數:Useful (1)
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
I have a suspicion. https://moodle.org/plugins/pluginversions.php?plugin=mod_hvp shows the release date 2020080400. Mein has 2020082800. Possibly I got a development version through Git.

What is the safe way to downgrade? When I simply swap the hvp directory, Moodle recognizes and brings me "Higher version installed".
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Daniel Thies發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
The default for the task is to run at the end of each month. That is probably what happened. Git does not actually have any content types. The task has to run in order to fetch them.
In reply to Daniel Thies

Re: H5P plug-in, the editor loads only if the language setting is English

Stuart Mealor發表於
Particularly helpful Moodlers的相片
I posted about similar issue earlier.
Having upgraded around 50 sites in the last month I saw two that had the 'missing content' issue.
At least one of these had added the first 4 H5P content types, and then stopped.
Running the scheduled tasks just failed, with errors including 'duplicate' entries - which I couldn't find.
In both cases we needed a feast solution, so just bounced the data to a new server and reinstalled (I know this isn't an easy option for everyone).
I am not seeing the error again, so I am also of the opinion that a specific version release of Moodle caused this (e.g. 3.9.x) and it has been solved now ... the only thing that occurs to me is an issue connecting to the H5P repository when doing the first download.
Stu
評比平均分數:Useful (1)
In reply to Stuart Mealor

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi you both

Thanks for all the help! Unfortunately we didn't detect that creating content in hvp had this "Loading, pleae wait" problem in the test upgrade, the old contents all worked. So I upgraded the production server over the weekend. I have a full site backup of the 3.5 just before upgrade to 3.9 (two working days ago) and a copy of the same 3.5 running in a sub-directory (eg. mysite/35/). I also have full automatic course backups of the same.

Because of a few courses with hvp content, I don't want to roll back the whole site. What I will do is to restore only those courses which have hvp content from the 3.5 final course backups. Before that I want hvp plug-in working cleanly in the production (3.9) server. So a "destructive" plug-in downgrade is OK with me. How do I do that? (I think, that is what Stuart meant.) By clean I mean, let the plug-in deinstall (20200828) / install (20200804) clean all the corrupt downloads, etc. I am not famliliar with the h5p plug-in to debug nor clean the site manually.
In reply to Daniel Thies

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Daniel

I forgot to mention: I edited task table yesterday to every hour. Yes, I assumed that the Git version is only code. But if the code is ahead of the stable, there is a chance it fetched a "future" library which is incompatible.

Whatever, I am going to do the deinstall/install as in the other post, an hour ago.
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Took the risk, 'f course after taking a full site backup, deinstalled mod_hvp (20200828), taking all the H5P activities with it, and reinstalled mod_hvp stable (20200804); already I can create new H5P content, in English and in German language settings.

Now, what else do I have to configure mod_hvp? I was going around setting up hvp activity and mod_hvp yesterday, which I don't want to repeat today.
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
During course restorations it throws a warning "The instance of this module does not exist" but finishes with success. The few courses I have restored seem to work.

I am still interested in "What else do I have to configure mod_hvp?" (Haven't done anything, just installed mod_hvp.)
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English [RESOLVED]

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片

I found out why I've installed the mod_hvp $plugin->version = 2020082800 and not the 2020080400 version. Because that is what the documentation on GitHub says:

git clone -b master https://github.com/h5p/h5p-moodle-plugin.git hvp && cd hvp && git submodule update --init

Ref https://github.com/h5p/moodle-mod_hvp

whereas https://moodle.org/plugins/pluginversions.php?plugin=mod_hvp offers https://moodle.org/plugins/download.php/22165/mod_hvp_moodle39_2020080400.zip for download. The GitHub version is not compatible with Moodle rel. 3.9, at least that is what caused the "Loading, please wait" in the H5P editor.

As I already said, I deinstalled the GitHub version of the plug-in, sacrificing all the H5P activities, reinstalled the Zip version, restored the courses which lost H5P activities.

I don't know whether this is the right forum. Looking at the links on the forum header, this looks like a forum for the new H5P activity in the Moodle core, the blue icon, since somewhere 3.8/3.9. All the "Useful links" on https://moodle.org/plugins/mod_hvp point to h5p.org sites.

Whatever, the issue resolved, but with a "bump".

In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English [RESOLVED]

Stuart Mealor發表於
Particularly helpful Moodlers的相片
People use this Forum for discussing both the H5P maintained plugin, and the H5P core functionality from Moodle 3.8.
Logically the links on the plugin page you refer to will be for the plugin.
評比平均分數:Useful (1)
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English [RESOLVED]

Oliver Tacke發表於
Particularly helpful Moodlers的相片
I think you overlooked the warning that's written right above the git command that you mentioned:

"Warning! Never use the development version in production, there are no guarantees for which state the development branches are in at a given time." 

If you prefer to install the plugin via github, you should use the stable branch, not the master branch.
評比平均分數:Useful (2)
In reply to Oliver Tacke

Re: H5P plug-in, the editor loads only if the language setting is English [RESOLVED]

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi Stuart

Good to know that the H5P maintained plug-in is also discussed here. We have a small but very enthusiastic group of teachers who've discovered H5P and are very happy with it. I want to disturb them as little as possible. They all use mod_hvp, as we've just migrated from Moodle rel. 3.5 to 3.9 (both LTS).

On a side-note, the confusion with the "black and blue" H5Ps has already started.

Hi Oliver

Thanks for the reply. As already said, good to know that both H5P methods are supported here.

I learned my lesson not to copy-and-paste Git commands without studying them. I'm the person, who otherwise preach the same for Shell commands - now it is my chance to bite the bullet. As for the GitHub instructions, if you expect more illiterates will visit your site, just as a safety measure why not put instructions on how to download (check in) stable versions of mod_hvp? See https://docs.moodle.org/39/en/Git_for_Administrators#Obtaining_the_code_from_Git for a template.

That said, there is a new turn in the saga. I went back to the staging server and noticed that the plug-in works - in both languages. The difference between the two servers was the theme.

So the corrected conclusion is:
- mod_hvp 20200828 works with Moodle 3.9 and Rebel 1.7.1 (2020120700)
- but not with theme_eguru_moodle39_2020073000.zip nor with Boost (2020061500)!
(mod_hvp 20200804 works with all three themes)

"Works" means the editor loads in German. For details, see the original post.
In reply to Visvanath Ratnaweera

Re: H5P plug-in, the editor loads only if the language setting is English [RESOLVED]

Oliver Tacke發表於
Particularly helpful Moodlers的相片

Hi Visvanath!

It is not my site. I am not affiliated with the H5P core team, so I don't know why it was phrased or done this way. But I am sure that pull requests intended to improve the documentation are just as welcome as pull requests to the code.

Best,

Oliver