Reviewed: https://reviews.mahara.org/9634 Committed: https://git.mahara.org/mahara/mahara/commit/6d19103ac29c352e0b862bfc0a49d782e838281f Submitter: Robert Lyon ([email protected]) Branch: master
commit 6d19103ac29c352e0b862bfc0a49d782e838281f Author: Kevin Dibble <[email protected]> Date: Fri Mar 22 16:06:47 2019 +1300 Bug 1803101: peer assessment artefact import Need to define owner and block when creating a peer assessment artefact while importing Create a temp block to assign on artefact creation that later needs to be replaced by the actual block when it's available Draft assessments should not be exported or imported. For exported portfolios created on older version of Mahara, there is no way of knowing if they are drafts at the moment of importing because this information was not included in the leap2A export xml file. Not importing draft peer assessments should work from this patch. It also adds a fix to support Postgres and MySQL when a table column name is a reserved word. Removing not null restriction for "usr" field in "artefact_peer_assessment" table: - The author in peer assessment table should be working as comments table. - For each comment, there is an entry in 'artefact' table that contains author and authorname, and another entry in 'artefact_comment_comment' that doesn't have an author field because we already have one in 'artefact' table. - We should have something similar on 'artefact_peer_assessment'. There is already an author field in 'artefact' table, then the 'usr' field in 'artefact_peer_assessment' should not to have a 'not null' restriction. If the peer assessment artefact has been imported and the author is not present in this site, then the 'usr' should be allowed to be null. behatnotneeded Change-Id: I182520159d1fcbc072081c2d976cdc68cde5e19d -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1803101 Title: Error importing Leap2A w/ peer assessment Status in Mahara: Fix Committed Bug description: I exported a simple portfolio page as Leap2A and got the error messages below when importing it via the admin interface. The Leap2A file is attached. [WAR] 37 (lib/adodb/adodb-exceptions.inc.php:45) Array to string conversion Call stack (most recent first): log_message("Array to string conversion", 8, true, true, "/home/kristina/code/mahara/htdocs/lib/adodb/adodb-...", 45) at /home/kristina/code/mahara/htdocs/lib/errors.php:520 error(8, "Array to string conversion", "/home/kristina/code/mahara/htdocs/lib/adodb/adodb-...", 45, array(size 7)) at /home/kristina/code/mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:45 ADODB_Exception->__construct("postgres8", "adodb_throw", -1, "ERROR: null value in column "block" violates not-...", "INSERT INTO "artefact_peer_assessment" ("assessmen...", array(size 3), object(ADODB_postgres8)) at /home/kristina/code/mahara/htdocs/lib/adodb/adodb-exceptions.inc.php:80 adodb_throw("postgres8", "adodb_throw", -1, "ERROR: null value in column "block" violates not-...", "INSERT INTO "artefact_peer_assessment" ("assessmen...", array(size 3), object(ADODB_postgres8)) at /home/kristina/code/mahara/htdocs/lib/adodb/adodb.inc.php:313 ADODB_TransMonitor("postgres8", "adodb_throw", -1, "ERROR: null value in column "block" violates not-...", "INSERT INTO "artefact_peer_assessment" ("assessmen...", array(size 3), object(ADODB_postgres8)) at /home/kristina/code/mahara/htdocs/lib/adodb/adodb.inc.php:1263 ADOConnection->_Execute("INSERT INTO "artefact_peer_assessment" ("assessmen...", array(size 3)) at /home/kristina/code/mahara/htdocs/lib/adodb/adodb.inc.php:1223 ADOConnection->Execute("INSERT INTO "artefact_peer_assessment" ("assessmen...", array(size 3)) at /home/kristina/code/mahara/htdocs/lib/dml.php:1102 insert_record("artefact_peer_assessment", object(stdClass)) at /home/kristina/code/mahara/htdocs/artefact/peerassessment/lib.php:240 ArtefactTypePeerassessment->commit() at /home/kristina/code/mahara/htdocs/artefact/peerassessment/import/leap/lib.php:180 LeapImportPeerassessment::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:1813 call_static_method("LeapImportPeerassessment", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/import/leap/lib.php:665 PluginImportLeap->import_from_load_mapping() at /home/kristina/code/mahara/htdocs/import/leap/lib.php:188 PluginImportLeap->process() at /home/kristina/code/mahara/htdocs/admin/users/add.php:348 adduser_submit(object(Pieform), array(size 24)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:542 Pieform->__construct(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:164 Pieform::process(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:5258 pieform(array(size 8)) at /home/kristina/code/mahara/htdocs/admin/users/add.php:156 [WAR] 37 (lib/errors.php:858) Failed to get a recordset: postgres8 error: [-1: ERROR: null value in column "block" violates not-null constraint DETAIL: Failing row contains (22, null, null, 11, 0).] in adodb_throw(INSERT INTO "artefact_peer_assessment" ("assessment", "view", "private") VALUES (?, ?, ?), Array)Command was: INSERT INTO "artefact_peer_assessment" ("assessment", "view", "private") VALUES (?, ?, ?) and values was (assessment:22,view:11,private:0) Call stack (most recent first): log_message("Failed to get a recordset: postgres8 error: [-1: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:95 log_warn("Failed to get a recordset: postgres8 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:858 SQLException->__construct("Failed to get a recordset: postgres8 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:1105 insert_record("artefact_peer_assessment", object(stdClass)) at /home/kristina/code/mahara/htdocs/artefact/peerassessment/lib.php:240 ArtefactTypePeerassessment->commit() at /home/kristina/code/mahara/htdocs/artefact/peerassessment/import/leap/lib.php:180 LeapImportPeerassessment::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:1813 call_static_method("LeapImportPeerassessment", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/import/leap/lib.php:665 PluginImportLeap->import_from_load_mapping() at /home/kristina/code/mahara/htdocs/import/leap/lib.php:188 PluginImportLeap->process() at /home/kristina/code/mahara/htdocs/admin/users/add.php:348 adduser_submit(object(Pieform), array(size 24)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:542 Pieform->__construct(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:164 Pieform::process(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:5258 pieform(array(size 8)) at /home/kristina/code/mahara/htdocs/admin/users/add.php:156 [WAR] 37 (lib/dml.php:1105) Failed to get a recordset: postgres8 error: [-1: ERROR: null value in column "block" violates not-null constraint DETAIL: Failing row contains (22, null, null, 11, 0).] in adodb_throw(INSERT INTO "artefact_peer_assessment" ("assessment", "view", "private") VALUES (?, ?, ?), Array)Command was: INSERT INTO "artefact_peer_assessment" ("assessment", "view", "private") VALUES (?, ?, ?) and values was (assessment:22,view:11,private:0) Call stack (most recent first): insert_record("artefact_peer_assessment", object(stdClass)) at /home/kristina/code/mahara/htdocs/artefact/peerassessment/lib.php:240 ArtefactTypePeerassessment->commit() at /home/kristina/code/mahara/htdocs/artefact/peerassessment/import/leap/lib.php:180 LeapImportPeerassessment::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:1813 call_static_method("LeapImportPeerassessment", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 0)) at /home/kristina/code/mahara/htdocs/import/leap/lib.php:665 PluginImportLeap->import_from_load_mapping() at /home/kristina/code/mahara/htdocs/import/leap/lib.php:188 PluginImportLeap->process() at /home/kristina/code/mahara/htdocs/admin/users/add.php:348 adduser_submit(object(Pieform), array(size 24)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:542 Pieform->__construct(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:164 Pieform::process(array(size 8)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:5258 pieform(array(size 8)) at /home/kristina/code/mahara/htdocs/admin/users/add.php:156 To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1803101/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

