elearning-ostfalia / moodle-qtype_proforma

qtype proforma (a moodle-plugin for programming exercises)
0 stars 1 forks source link

Error on update #7

Closed programaciondeverdad closed 1 month ago

programaciondeverdad commented 1 year ago

Actual Version: 2021123100 New Version: 2023011600

On Update Data Base, it crashes' I've been downloaded the plugin from the button inside the website Moodle. And, when I will update the data base, throws me this error: qtype_proforma Error escribiendo a la base de datos

Más información sobre este error

Información de depuración: ERROR: column "versioncontrol" does not exist LINE 1: ...ptions SET vcssystem = "2" WHERE responseformat = "versionco... ^ UPDATE mdl_qtype_proforma_options SET vcssystem = "2" WHERE responseformat = "versioncontrol" [array ( )] Error code: dmlwriteexception×Descartar esta notificación Trazado de la pila (stack): line 497 of /lib/dml/moodle_database.php: dml_write_exception thrown line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end() line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end() line 846 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end() line 340 of /question/type/proforma/db/upgrade.php: call to pgsql_native_moodle_database->execute() line 784 of /lib/upgradelib.php: call to xmldb_qtype_proforma_upgrade() line 1953 of /lib/upgradelib.php: call to upgrade_plugins() line 721 of /admin/index.php: call to upgrade_noncore()

programaciondeverdad commented 1 year ago

Ok. I found the error. The problem is in double quotes. In postgresql, double quotes is for column names. So, it is trying to found a column, when is a simple string. I will make a fork, with these changes after trying in my enviroment. Please, let me know how to contribute with you.

Thanks

KBorm commented 1 year ago

Yes, the following code should solve the problem

upgrade.php, lines 338-340:

        $DB->execute('UPDATE {qtype_proforma_options} '.
            'SET vcssystem = "2" ' .
            'WHERE responseformat = :responseformat', ['responseformat' => 'versioncontrol']);
KBorm commented 1 month ago

solution available