Forums | Mahara Community

Developers /
Own Plugin: Install.xml/Create Tables not working


anonymous profile picture
Deleted user
Posts: 5

13 February 2013, 3:53 AM

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

Call stack (most recent first):
  • 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?

Aaron Wells's profile picture
Posts: 896

19 February 2013, 12:11 PM

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:

[DBG] 52 (lib/dml.php:159) postgres7 error: [-1: ERROR:  syntax error at or near "this"
LINE 1: this is bad sql
        ^] in EXECUTE("this is bad sql")
Command was: this is bad sql
[WAR] 52 (lib/errors.php:749) Could not execute command: this is bad sql
Call stack (most recent first):
  • 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
[WAR] 52 (lib/dml.php:161) Could not execute command: this is bad sql
Call stack (most recent first):
  • execute_sql("this is bad sql") at /home/aaronw/www/mahara/htdocs/test.php:6
Kristina Hoeppner's profile picture
Posts: 3864

03 March 2013, 11:42 AM

Hello Peggy,

Did you get in touch with the Totara devs? They are also planning of integrating badges in Mahara.

Cheers

Kristina

3 results