itamart / moodle-mod_dataform

The Dataform is an enhanced counterpart of the standard Database activity module
17 stars 19 forks source link

Dataform error after duplication #18

Open sgodbehere01 opened 5 years ago

sgodbehere01 commented 5 years ago

Hi there,

We appear to have an issue with the attached dataform, when duplicated in anyway on Moodle (Duplicate or back-up/restore) attempting to add new entries fails with the following:

Error reading from database

More information about this error

×Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS DECIMAL(65,7)) ASC' at line 1 SELECT e.id, e.dataid, e.state, e.timecreated, e.timemodified, e.userid, e.groupid, e.type , u.id AS uid ,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.idnumber,u.username FROM mdl_dataform_entries e JOIN mdl_user u ON u.id = e.userid LEFT JOIN mdl_dataform_contents c128 ON c128.fieldid = 128 AND c128.entryid = e.id WHERE e.dataid = ? AND e.userid = ? AND e.groupid = ? ORDER BY u.lastname ASC, CAST(c128. AS DECIMAL(65,7)) ASC [array ( 0 => '13', 1 => '6766', 2 => 0, )] Error code: dmlreadexception ×Stack trace: line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 234 of /mod/dataform/classes/entry_manager.php: call to mysqli_native_moodle_database->get_records_sql() line 142 of /mod/dataform/classes/entry_manager.php: call to mod_dataform_entry_manager->fetch_entries() line 332 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform_entry_manager->set_content() line 315 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform\pluginbase\dataformview->set_entries_content() line 466 of /mod/dataform/classes/dataform.php: call to mod_dataform\pluginbase\dataformview->display() line 71 of /mod/dataform/view.php: call to mod_dataform_dataform->display()

This has been tested on another Moodle site where the same behaviour occurs, in that a restored version of it will fail when adding new entries, and a copy with the same settings made from scratch works but a duplicate of that will not.

This is occurring on a Moodle 3.5.6 instance. The error should recreate by restoring the attached file .mbz file in the .zip into a course. If you'd like to test the form when it's working it seems you will need to create it from scratch.

Any ideas what may be caused this and what the solution may be? Thanks for any help that can be offered.

dataform error.zip

Kind regards,

Sam

fvendrell commented 5 years ago

Hello,

It reminds me of a problem I had. This might be an issue regarding the sorting properties (ascending/descending) of the filters. So this what I would suggest:

  1. Take note of all the filters sorting parameters.
  2. Suppress the filter sorting properties and only these.
  3. Backup and restore
  4. Create again the filter sorting properties.

I am sure that Itamart will be able to correct this bug... Note that I am not a Moodle expert although I hope that this will help... Regards :-)

fvendrell commented 5 years ago

Hello again Sam, Could you tell me if you have encountered other problems of compatibility between Dataform and Moodle 3.5 (or 3.6) ? I am asking this because I am hesitating in upgrading form Moodle 3.3 to 3.5 or 3.6 (before the next release of Dataform). The database plugin is a central piece of my Moodle website... Best regards

sgodbehere01 commented 5 years ago

Hi Fvendrell,

This has resolved the issue thanks! It seems that on the Dataform having issues, switching the filters off is enough but then backing that up, restoring it and turning the filter back on causes it to error out again, so it appears to be an issue particular to the filters on any duplicated activity, which is something I think we can live with.

R.E Other issues: I can't say I've encountered anything other than this particular filter issue but this is still being tested by us, it's not running on a production site so I can't speak as to whether you may encounter issues during the upgrade process or as it's being used activity on 3.5.

Thanks again for your help.

Kind regards,

Sam

hartmut1s commented 5 years ago

Hi Fvendrell,

I use the Dataform module (version 3.3.2 - 2017051502) in Moodle 3.6.1 mainly as a journal activity and group peer review. So far I couldn't figure out in the group peer review activity how students will receive a notification after I have graded their review (phase 2). Other than this I haven't encountered any problems with the Dataform module.

With kind regards, Hartmut

fvendrell commented 5 years ago

Hello hartmut1s and sgodbehere01, Thank you very much for your feedback, I will thus proceed to my Moodle website update soon ! :-) Regards