Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database error after upgrading to v3.3.2 #16

Open
julianrubisch opened this issue Feb 13, 2018 · 3 comments
Open

Database error after upgrading to v3.3.2 #16

julianrubisch opened this issue Feb 13, 2018 · 3 comments

Comments

@julianrubisch
Copy link

I recently upgraded to Moodle 3.3.4 (Build: 20180208), and upgraded mod_dataform to 3.3.2, afterwards got this error:

Debug info: Unknown column 'e.type' in 'field list'
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 WHERE e.dataid = ? ORDER BY e.id ASC 
[array (
0 => '11',
)]
Error code: dmlreadexception
Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1216 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()

as per https://moodle.org/plugins/mod_dataform, it seems there are others experiencing this error, too.

@julianrubisch
Copy link
Author

Apperently, the e.type field really doesn't exist.

Commenting out $etypeparams from

$params = array_merge($params, $etypeparams, $userparams, $groupparams, $sortparams);

and removing e.type from

$whatentry = ' e.id, e.dataid, e.state, e.timecreated, e.timemodified, e.userid, e.groupid, e.type ';

seems to fix the problem?

@logan-reynolds
Copy link

We are also seeing this on Totara 12 (essentially Moodle 3.3) running version 2017051502 release 3.3.2 of mod_dataform - any chance this issue will be worked on soon?

@logan-reynolds
Copy link

A little more info: I discovered that the plugin does actually work on a fresh plugin install, as the mdl_dataform_entries.type field exists in that case. The problem is that new fields are not getting created during the upgrade steps from a previous mod_dataform version - uninstalling the previous version seems to delete existing dataform instances, so simply uninstalling & reinstalling the latest 3.3.2 version is not a viable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants