Forums | Mahara Community

Support /
"Medical problems & conditions" Plugin / FATAL: XML file is not well formed!


Aaron Wells's profile picture
Posts: 896

03 March 2015, 14:15

Hi Amy,

It looks like that plugin hasn't been updated since Mahara 1.4. So, it may need some tweaking before it'll operate with Mahara 1.10.

The "Failed to install" message that you're seeing, indicates that Mahara printed some debug messages with more details about what went wrong. It may be helpful if you can locate those debug messages. They'll be present in your PHP error log file, or possibly in your Apache error log file, depending on how XAMPP does things.

If you can't find the more detailed Mahara debug messages in either of those files, try adding "$cfg->productionmode=false;" to your site's config.php file, and then re-installing the pc plugin. This should cause the debug messages to be printed directly to the web page instead of only to the log files.

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 4

03 March 2015, 16:55

Hi Aaron,

 Initially, I am getting the following because I have installed pc artefact a few times.

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\dml.php:147) mysqli error: [1050: Table 'artefact_pc_category' already exists] in adodb_throw(CREATE TABLE artefact_pc_category (
     category VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (category)
 )ENGINE=innodb, )
 Command was: CREATE TABLE artefact_pc_category (
     category VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (category)
 )ENGINE=innodb

 

[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Could not execute command: CREATE TABLE artefact_pc_category (
     category VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (category)
 )ENGINE=innodb

 

Call stack (most recent first): •log_message("Could not execute command: CREATE TABLE artefact_p...", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:148
•execute_sql("CREATE TABLE artefact_pc_category ( category V...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:1382
•execute_sql_arr(array(size 5)) at C:\xampp\apps\mahara\htdocs\lib\ddl.php:750
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\dml.php:147) mysqli error: [1050: Table 'artefact_pc_item' already exists] in EXECUTE("CREATE TABLE artefact_pc_item (
     id BIGINT(10) NOT NULL auto_increment,
     category VARCHAR(255) DEFAULT NULL,
     item VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (id),
 CONSTRAINT artepcitem_cat_fk FOREIGN KEY (category) REFERENCES artefact_pc_category (category),
 CONSTRAINT artepcitem_catite_uk UNIQUE (category, item)
 )ENGINE=innodb")
 Command was: CREATE TABLE artefact_pc_item (
     id BIGINT(10) NOT NULL auto_increment,
     category VARCHAR(255) DEFAULT NULL,
     item VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (id),
 CONSTRAINT artepcitem_cat_fk FOREIGN KEY (category) REFERENCES artefact_pc_category (category),
 CONSTRAINT artepcitem_catite_uk UNIQUE (category, item)
 )ENGINE=innodb

 

[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Could not execute command: CREATE TABLE artefact_pc_item (
     id BIGINT(10) NOT NULL auto_increment,
     category VARCHAR(255) DEFAULT NULL,
     item VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (id),
 CONSTRAINT artepcitem_cat_fk FOREIGN KEY (category) REFERENCES artefact_pc_category (category),
 CONSTRAINT artepcitem_catite_uk UNIQUE (category, item)
 )ENGINE=innodb

 

Call stack (most recent first): •log_message("Could not execute command: CREATE TABLE artefact_p...", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:148
•execute_sql("CREATE TABLE artefact_pc_item ( id BIGINT(10) ...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:1382
•execute_sql_arr(array(size 5)) at C:\xampp\apps\mahara\htdocs\lib\ddl.php:750
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\dml.php:147) mysqli error: [1050: Table 'artefact_pc_itemmap' already exists] in EXECUTE("CREATE TABLE artefact_pc_itemmap (
     parentid BIGINT(10) NOT NULL,
     childid BIGINT(10) NOT NULL,
     childiscore TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepcitem_par_fk FOREIGN KEY (parentid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_chi_fk FOREIGN KEY (childid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_parchi_uk UNIQUE (parentid, childid)
 )ENGINE=innodb")
 Command was: CREATE TABLE artefact_pc_itemmap (
     parentid BIGINT(10) NOT NULL,
     childid BIGINT(10) NOT NULL,
     childiscore TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepcitem_par_fk FOREIGN KEY (parentid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_chi_fk FOREIGN KEY (childid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_parchi_uk UNIQUE (parentid, childid)
 )ENGINE=innodb

 

[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Could not execute command: CREATE TABLE artefact_pc_itemmap (
     parentid BIGINT(10) NOT NULL,
     childid BIGINT(10) NOT NULL,
     childiscore TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepcitem_par_fk FOREIGN KEY (parentid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_chi_fk FOREIGN KEY (childid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_parchi_uk UNIQUE (parentid, childid)
 )ENGINE=innodb

 

Call stack (most recent first): •log_message("Could not execute command: CREATE TABLE artefact_p...", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:148
•execute_sql("CREATE TABLE artefact_pc_itemmap ( parentid BI...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:1382
•execute_sql_arr(array(size 5)) at C:\xampp\apps\mahara\htdocs\lib\ddl.php:750
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\dml.php:147) mysqli error: [1050: Table 'artefact_pc_item2casenote' already exists] in EXECUTE("CREATE TABLE artefact_pc_item2casenote (
     itemid BIGINT(10) NOT NULL,
     casenoteid BIGINT(10) NOT NULL,
 CONSTRAINT artepcitem_ite_fk FOREIGN KEY (itemid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_cas_fk FOREIGN KEY (casenoteid) REFERENCES artefact (id),
 CONSTRAINT artepcitem_itecas_uk UNIQUE (itemid, casenoteid)
 )ENGINE=innodb")
 Command was: CREATE TABLE artefact_pc_item2casenote (
     itemid BIGINT(10) NOT NULL,
     casenoteid BIGINT(10) NOT NULL,
 CONSTRAINT artepcitem_ite_fk FOREIGN KEY (itemid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_cas_fk FOREIGN KEY (casenoteid) REFERENCES artefact (id),
 CONSTRAINT artepcitem_itecas_uk UNIQUE (itemid, casenoteid)
 )ENGINE=innodb

 

[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Could not execute command: CREATE TABLE artefact_pc_item2casenote (
     itemid BIGINT(10) NOT NULL,
     casenoteid BIGINT(10) NOT NULL,
 CONSTRAINT artepcitem_ite_fk FOREIGN KEY (itemid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_cas_fk FOREIGN KEY (casenoteid) REFERENCES artefact (id),
 CONSTRAINT artepcitem_itecas_uk UNIQUE (itemid, casenoteid)
 )ENGINE=innodb

 

Call stack (most recent first): •log_message("Could not execute command: CREATE TABLE artefact_p...", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:148
•execute_sql("CREATE TABLE artefact_pc_item2casenote ( itemi...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:1382
•execute_sql_arr(array(size 5)) at C:\xampp\apps\mahara\htdocs\lib\ddl.php:750
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\dml.php:147) mysqli error: [1050: Table 'artefact_pc_casenote' already exists] in EXECUTE("CREATE TABLE artefact_pc_casenote (
     id BIGINT(10) NOT NULL,
     etime DATETIME NOT NULL,
     shared TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepccase_id_fk FOREIGN KEY (id) REFERENCES artefact (id)
 )ENGINE=innodb")
 Command was: CREATE TABLE artefact_pc_casenote (
     id BIGINT(10) NOT NULL,
     etime DATETIME NOT NULL,
     shared TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepccase_id_fk FOREIGN KEY (id) REFERENCES artefact (id)
 )ENGINE=innodb

 

[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Could not execute command: CREATE TABLE artefact_pc_casenote (
     id BIGINT(10) NOT NULL,
     etime DATETIME NOT NULL,
     shared TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepccase_id_fk FOREIGN KEY (id) REFERENCES artefact (id)
 )ENGINE=innodb

 

Call stack (most recent first): •log_message("Could not execute command: CREATE TABLE artefact_p...", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Could not execute command: CREATE TABLE artefact_p...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:148
•execute_sql("CREATE TABLE artefact_pc_casenote ( id BIGINT(...") at C:\xampp\apps\mahara\htdocs\lib\dml.php:1382
•execute_sql_arr(array(size 5)) at C:\xampp\apps\mahara\htdocs\lib\ddl.php:750
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

[DBG] 42 (C:\xampp\apps\mahara\htdocs\lib\ddl.php:751) Array
 (
     [0] => CREATE TABLE artefact_pc_category (
     category VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (category)
 )ENGINE=innodb
     [1] => CREATE TABLE artefact_pc_item (
     id BIGINT(10) NOT NULL auto_increment,
     category VARCHAR(255) DEFAULT NULL,
     item VARCHAR(255) NOT NULL,
 CONSTRAINT  PRIMARY KEY (id),
 CONSTRAINT artepcitem_cat_fk FOREIGN KEY (category) REFERENCES artefact_pc_category (category),
 CONSTRAINT artepcitem_catite_uk UNIQUE (category, item)
 )ENGINE=innodb
     [2] => CREATE TABLE artefact_pc_itemmap (
     parentid BIGINT(10) NOT NULL,
     childid BIGINT(10) NOT NULL,
     childiscore TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepcitem_par_fk FOREIGN KEY (parentid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_chi_fk FOREIGN KEY (childid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_parchi_uk UNIQUE (parentid, childid)
 )ENGINE=innodb
     [3] => CREATE TABLE artefact_pc_item2casenote (
     itemid BIGINT(10) NOT NULL,
     casenoteid BIGINT(10) NOT NULL,
 CONSTRAINT artepcitem_ite_fk FOREIGN KEY (itemid) REFERENCES artefact_pc_item (id),
 CONSTRAINT artepcitem_cas_fk FOREIGN KEY (casenoteid) REFERENCES artefact (id),
 CONSTRAINT artepcitem_itecas_uk UNIQUE (itemid, casenoteid)
 )ENGINE=innodb
     [4] => CREATE TABLE artefact_pc_casenote (
     id BIGINT(10) NOT NULL,
     etime DATETIME NOT NULL,
     shared TINYINT(1) NOT NULL DEFAULT 0,
 CONSTRAINT artepccase_id_fk FOREIGN KEY (id) REFERENCES artefact (id)
 )ENGINE=innodb
 )

 


[WAR] 42 (C:\xampp\apps\mahara\htdocs\lib\errors.php:745) Failed to install (check logs for xmldb errors)

 

Call stack (most recent first): •log_message("Failed to install (check logs for xmldb errors)", 8, true, true) at C:\xampp\apps\mahara\htdocs\lib\errors.php:95
•log_warn("Failed to install (check logs for xmldb errors)") at C:\xampp\apps\mahara\htdocs\lib\errors.php:745
•SQLException->__construct("Failed to install (check logs for xmldb errors)") at C:\xampp\apps\mahara\htdocs\lib\ddl.php:752
•install_from_xmldb_file("C:\xampp\apps\mahara\htdocs/artefact/pc/db/install...") at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:429
•upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86

 

Then I dropped all pc tables and reinstall pc plugin, and get the followinging errors:

[INF] 45 (C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php:97) Beginning resync of conditions list
[WAR] 45 (C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php:100) simplexml_load_file(): I/O warning : failed to load external entity "C:\xampp\apps\mahara\htdocs/artefact/pc/conditions.xml"
Call stack (most recent first):
  • log_message("simplexml_load_file(): I/O warning : failed to loa...", 8, true, true, "C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php", 100) at C:\xampp\apps\mahara\htdocs\lib\errors.php:439
  • error(2, "simplexml_load_file(): I/O warning : failed to loa...", "C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php", 100, array(size 2)) at Unknown:0
  • simplexml_load_file("C:\xampp\apps\mahara\htdocs/artefact/pc/conditions...") at C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php:100
  • PluginArtefactPc::resync_conditions() at C:\xampp\apps\mahara\htdocs\artefact\pc\lib.php:84
  • PluginArtefactPc::postinst(0) at Unknown:0
  • call_user_func_array(array(size 2), array(size 1)) at C:\xampp\apps\mahara\htdocs\lib\mahara.php:1578
  • call_static_method("PluginArtefactPc", "postinst", 0) at C:\xampp\apps\mahara\htdocs\lib\upgrade.php:585
  • upgrade_plugin(object(stdClass)) at C:\xampp\apps\mahara\htdocs\admin\upgrade.json.php:86
Aaron Wells's profile picture
Posts: 896

04 March 2015, 10:23

Hm, so it looks like the problem is that the simplexml_load_file() method can't load your XML file.

Try checking the file permissions on the conditions.xml file. Make sure that it's readable by your web browser. (I don't know exactly what that would look like in Windows, unfortunately. Maybe try comparing that file's permissions to the other files in the same directory.)

If the file permissions look okay, maybe you could try this workaround to use file_get_contents() instead: http://stackoverflow.com/questions/21079951/failing-to-read-xml-file-with-phps-simplexml-load-file-in-localhost-xampp

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 4

04 March 2015, 17:10

That's great.  The workaround works now.  I can install and use the plugin.  But when I create a new case note.  Getting the following:

[WAR] 79 (C:\xampp\apps\mahara\htdocs\lib\form\elements\filebrowser.php:121) Undefined index: resizeonuploaduseroption
Call stack (most recent first):
  • log_message("Undefined index: resizeonuploaduseroption", 8, true, true, "C:\xampp\apps\mahara\htdocs\lib\form\elements\file...", 121) at C:\xampp\apps\mahara\htdocs\lib\errors.php:439
  • error(8, "Undefined index: resizeonuploaduseroption", "C:\xampp\apps\mahara\htdocs\lib\form\elements\file...", 121, array(size 17)) at C:\xampp\apps\mahara\htdocs\lib\form\elements\filebrowser.php:121
  • pieform_element_filebrowser(object(Pieform), array(size 15)) at C:\xampp\apps\mahara\htdocs\lib\pieforms\pieform.php:1436
  • Pieform->build_element_html(array(size 15)) at C:\xampp\apps\mahara\htdocs\lib\pieforms\pieform.php:676
  • Pieform->build() at C:\xampp\apps\mahara\htdocs\lib\pieforms\pieform.php:163
  • Pieform::process(array(size 12)) at C:\xampp\apps\mahara\htdocs\lib\pieforms\pieform.php:71
  • pieform(array(size 12)) at C:\xampp\apps\mahara\htdocs\artefact\pc\addcasenote.php:155
24 results