Forums | Mahara Community
Developers
/
Own Plugin: Install.xml/Create Tables not working
13 February 2013, 3:53
Hello,
iam implementing an artefact plugin for Integration of Badges into Mahara. With the help of the Totara LMS technical spec for Integration it into moodle, i defined the needed tables in install.xml, but an error occurs always when trying to install my plugin:
Could not execute command: CREATE TABLE artefact_badges_badge ( badgeid BIGINT(10) NOT NULL, name VARCHAR(255) NOT NULL, description MEDIUMTEXT, image VARCHAR(1024) NOT NULL DEFAULT '0', visible TINYINT(2) NOT NULL DEFAULT 1, ctime BIGINT(10) NOT NULL DEFAULT 0, mtime BIGINT(10) NOT NULL DEFAULT 0, usermodified BIGINT(10) NOT NULL, issuername VARCHAR(255) NOT NULL, issuerurl VARCHAR(255) NOT NULL, issuercontact VARCHAR(255) DEFAULT NULL, groupid VARCHAR(255) DEFAULT NULL, message MEDIUMTEXT, CONSTRAINT PRIMARY KEY (badgeid), CONSTRAINT artebadgbadg_use_fk FOREIGN KEY (usermodified) REFERENCES usr (id), CONSTRAINT artebadgbadg_gro_fk FOREIGN KEY (groupid) REFERENCES `group` (id) )ENGINE=innodb
- execute_sql("CREATE TABLE artefact_badges_badge ( badgeid B...") at .../mahara/htdocs/lib/dml.php:1395
- execute_sql_arr(array(size 14)) at.../mahara/htdocs/lib/ddl.php:645
- install_from_xmldb_file("/.../mahara/htdocs/artefact/badg...") at ...mahara/htdocs/lib/upgrade.php:368
- upgrade_plugin(object(stdClass)) at .../mahara/htdocs/admin/upgrade.json.php:94
I think its a syntax problem or a definition problem, iam totally new on defining tables and XMLDB. Can somebody help?
19 February 2013, 12:11
Do you have debugging output turned all the way on (as described here https://wiki.mahara.org/index.php/Developer_Area/Developer_Environment#Initial_installation_of_your_developer_environment_on_your_computer )? If there is a SQL syntax error, adodb should print the actual syntax error from the database. Like this:
LINE 1: this is bad sql
^] in EXECUTE("this is bad sql")
Command was: this is bad sql
- log_message("Could not execute command: this is bad sql", 8, true, true) at /home/aaronw/www/mahara/htdocs/lib/errors.php:109
- log_warn("Could not execute command: this is bad sql") at /home/aaronw/www/mahara/htdocs/lib/errors.php:749
- SQLException->__construct("Could not execute command: this is bad sql") at /home/aaronw/www/mahara/htdocs/lib/dml.php:161
- execute_sql("this is bad sql") at /home/aaronw/www/mahara/htdocs/test.php:6
- execute_sql("this is bad sql") at /home/aaronw/www/mahara/htdocs/test.php:6
03 March 2013, 11:42
Hello Peggy,
Did you get in touch with the Totara devs? They are also planning of integrating badges in Mahara.
Cheers
Kristina