You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading to version v0.1.3 we started getting this exception on every single migration run.
Migrating ID:1 test course:2 h5p test course
test-1.h5p
Database transaction aborted automatically in /admin/tool/migratehvp2h5p/cli/migrate.php
Default exception handler: Exception - Call to a member function get_filename() on null Debug:
Error code: generalexceptionmessage
* line 465 of /admin/tool/migratehvp2h5p/classes/api.php: Error thrown
* line 301 of /admin/tool/migratehvp2h5p/classes/api.php: call to tool_migratehvp2h5p\api::prepare_draft_file_from_hvp()
* line 98 of /admin/tool/migratehvp2h5p/classes/api.php: call to tool_migratehvp2h5p\api::create_mod_h5pactivity()
* line 168 of /admin/tool/migratehvp2h5p/cli/migrate.php: call to tool_migratehvp2h5p\api::migrate_hvp2h5p()
Looking through the code, I think there is some missing logic.
in function prepare_draft_file_from_hvp of classes/api.php, it inserts a file record with component=draft,filearea=user and then calls $cbfile = $content->get_file(); which in return looks for a file record with component=contentbank,filearea=public
This file record is never created and so does not exist, and throws the exception above.
I can reproduce this every time by creating a new fresh Moodle site, installing the latest mod_hvp and creating an activity of type "Interactive Video" and giving it either a youtube link or uploading an mp4 then running the migration cli.
The text was updated successfully, but these errors were encountered:
Hi @durzo!
Thanks for reporting this. I've tried to reproduce the error on my local environment using Moodle master and 3.9, with several DB, such as PostgreSQL and MariaDB but it's working for me in all the cases, using clean Moodle instances and following your steps so I guess I'm missing something (because there is another issue which seems exactly the same you mentioned: #24 ).
Could you please give us more details about your environment (Moodle version, DB, PHP...) and the parameters you're using when running the migration tool to see if we can reproduce it? Thanks in advance! :-)
Thanks a lot for your help Jordan!!
I've been able to reproduce this issue in 3.9.0 and 3.9.1. It's related to changes done in https://tracker.moodle.org/browse/MDL-69143), so I've added an extra-check to create manually the file into the contentbank if it's not created :-)
Since upgrading to version v0.1.3 we started getting this exception on every single migration run.
Looking through the code, I think there is some missing logic.
in function prepare_draft_file_from_hvp of classes/api.php, it inserts a file record with component=draft,filearea=user and then calls
$cbfile = $content->get_file();
which in return looks for a file record with component=contentbank,filearea=publicThis file record is never created and so does not exist, and throws the exception above.
I can reproduce this every time by creating a new fresh Moodle site, installing the latest mod_hvp and creating an activity of type "Interactive Video" and giving it either a youtube link or uploading an mp4 then running the migration cli.
The text was updated successfully, but these errors were encountered: