Error saving ID module course not valid

Hi,
I get this error:
ID de módulo de curso no válida
Debug info: SELECT id,course FROM {course_modules} WHERE id IS NULL
[array (
)]
Error code: invalidcoursemodule

Stack trace:
line 1546 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 6817 of /lib/accesslib.php: call to moodle_database->get_record()
line 629 of /mod/hvp/classes/file_storage.php: call to context_module::instance()
line 443 of /mod/hvp/classes/file_storage.php: call to mod_hvp\file_storage->getFile()
line 262 of /mod/hvp/editor/h5peditor.class.php: call to mod_hvp\file_storage->cloneContentFile()
line 198 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processFile()
line 177 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 218 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processSemantics()
line 177 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 229 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processSemantics()
line 236 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 177 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 229 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processSemantics()
line 236 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 177 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 229 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processSemantics()
line 177 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 218 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processSemantics()
line 145 of /mod/hvp/editor/h5peditor.class.php: call to H5peditor->processField()
line 161 of /mod/hvp/lib.php: call to H5peditor->processParameters()
line 109 of /mod/hvp/lib.php: call to hvp_save_content()
line 577 of /course/modlib.php: call to hvp_update_instance()
line 153 of /course/modedit.php: call to update_moduleinfo()

Output buffer: 
Notice: Trying to get property 'id' of non-object in /apps/www/html/moodledev/mod/hvp/classes/file_storage.php on line 629

This error happens when I edit a H5P.
Software version: moodle 3.5, H5P version 1.10.

After check to deep I found this:

 

 

"originalImage": {"path": "../2323/images/file-5a6f35f78bf23.png","mime": "image/png","height": 826,"width": 822}

 

Presents in the field jsoncontent and filtered of the table mdl_hvp.

 

The value "../2323/" is index correspond to database's index original because that course was created in other moodle.

Delete this attribute originalImage disappeare the error.

Any help, thank

thomasmars's picture

Hi, can you elaborate on the steps required to reproduce this bug ?
Also, have you tried this in the latest version (1.13) ?

Steps:

  1. Create backup course from a mooodle with H5P version 1.5
  2. Restore backup course in a moodle with H5P version 1.10
  3. Edit a activity H5P.

Test v1.13

I got the same error.

thomasmars's picture

Hi, I'm not able to reproduce this using the steps you have provided.
How does the error manifest ? Is the image not showing ? Is the content not showing ?

Can you provide the backup file for further debugging ?