grabs / moodle-mod_unilabel

1 stars 10 forks source link

Error with grid feature after moodle upgrade from 3.11.15 to 4.2.1 #34

Closed schoenerw closed 1 year ago

schoenerw commented 1 year ago

Hello, I have a major problem with the unilabel grid feature after updating a moodle platform from moodle 3 to moodle 4. The platform contains about 300 courses with a lot of them using your unilabel grid feature. After the update, these grids in these 300 courses work just fine for students, but when a trainer tries to edit the content for minor changes, an error is thrown. Interesting detail: when I create a new course, now under moodle 4 on the same platform, I can create a unilabel grid element and edit it without problems. When I export a unilabel grid from a old course to a newly created course, I can edit the content. After reimporting the edited grid to the old course, there is the error again.

Description: I updated my Moodle 3.11.15+ to Moodle 4.2.1+, theme MOOVE before update version 3.11.05 2021052100, after update 4.1.1 2022112801 Before Update, the unilabel version was 3.11.5 (Build: 2022030200) , after update the version is 4.1.3 (Build: 2023061400) After the update, for students everything is working fine. But when a teacher wants to edit the content of a unilabel grid, we get an error.

Error: Object of class core_availability_multiple_messages could not be converted to string Debug-Info: Error code: generalexceptionmessage

Stack trace: line 78 of /var/www/vhosts/xxx.de/moodledata/localcache/mustache/1687413486/moove/Mustache_0fd0803e601382b80f9311bdae9e9b53.php: Error thrown line 253 of /var/www/vhosts/xxx.de/moodledata/localcache/mustache/1687413486/moove/__Mustache_0fd0803e601382b80f9311bdae9e9b53.php: call to Mustache_0fd0803e601382b80f9311bdae9e9b53->sectionCd620e8b4e52fb39bd1750a2d1563932() line 352 of /var/www/vhosts/xxx.de/moodledata/localcache/mustache/1687413486/moove/Mustache_0fd0803e601382b80f9311bdae9e9b53.php: call to __Mustache_0fd0803e601382b80f9311bdae9e9b53->sectionFeec6d43fbd2e108579ce39fdb94f70f() line 13 of /var/www/vhosts/xxx.de/moodledata/localcache/mustache/1687413486/moove/Mustache_0fd0803e601382b80f9311bdae9e9b53.php: call to Mustache_0fd0803e601382b80f9311bdae9e9b53->sectionE47731a573c162c0e20a77cd7be93b0c() line 47 of /var/www/vhosts/xxx.de/moodledata/localcache/mustache/1687413486/moove/__Mustache_e55ce88c9c4f08fde36fb4ff49f05cad.php: call to Mustache_0fd0803e601382b80f9311bdae9e9b53->renderInternal() line 67 of /lib/mustache/src/Mustache/Template.php: call to __Mustache_e55ce88c9c4f08fde36fb4ff49f05cad->renderInternal() line 208 of /lib/outputrenderers.php: call to Mustache_Template->render() line 267 of /lib/outputrenderers.php: call to renderer_base->render_from_template() line 128 of /mod/unilabel/type/grid/classes/content_type.php: call to renderer_base->render() line 152 of /mod/unilabel/classes/edit_content_form.php: call to unilabeltype_grid\content_type->add_form_fragment() line 80 of /mod/unilabel/classes/edit_content_form.php: call to mod_unilabel\edit_content_form->add_plugin_form_elements() line 214 of /lib/formslib.php: call to mod_unilabel\edit_content_form->definition() line 79 of /mod/unilabel/edit_content.php: call to moodleform->__construct()

Further actions from me: I deleted the localcache in moodledata, still error I changed the theme, deleted localcache in moodledata, still error I changed the format, deleted localacache in moodledata, still error

Maybe you have an idea, how to solve this problem. Best greetings Wolfgang

grabs commented 1 year ago

Hi Wolfgang,

thank you for reporting this. Unfortunately I can't reproduce this error. Is there any chance that you can provide me with a course backup (without userdata)? Thanks!

Best regards Andreas

grabs commented 1 year ago

Hi Wolfgang,

its me again. I just realised, you are using the plugin versions for Moodle 4.1 in your Moodle which is 4.2. Maybe you should upgrade all these plugins to the right version. Please tell me if the error is gone.

Thanks and best regards Andreas

schoenerw commented 1 year ago

Hi Andreas,

I am sorry, i made a mistake. I am using moodle 4.1.4+ I copied the wrong version into my text. So, I cant use the pluginversion for moodle 4.2

I would like to give you trainer access to a test platform with the problem.

How can I send you the login data? Thanks and best regards

Wolfgang

grabs commented 1 year ago

Hi Wolfgang,

now I could reproduce the errors and fix them. The checks are just running. After that I will publish the latest versions on moodle.org. The problem was a wrong handling of availability infos while rendering the new activity chooser for picking an activity.

Best regards Andreas

schoenerw commented 1 year ago

Andreas, your the greatest! Thank you very much for your help! I didnt expext such fast work! Wolfgang