Error when import a blog via self-Leap2A import

Bug #1360977 reported by Son Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Son Nguyen
1.10
Fix Released
Medium
Unassigned
15.04
Fix Released
Medium
Unassigned
15.10
Fix Released
Medium
Son Nguyen

Bug Description

Version: master(1.10)

When importing a single leap2a file using Portfolio/Import
I got the following error

[WAR] 70 (lib/adodb/adodb-exceptions.inc.php:43) Array to string conversion
Call stack (most recent first):
log_message("Array to string conversion", 8, true, true, "/home/sonn/code/mahara/master/htdocs/lib/adodb/ado...", 43) at /home/sonn/code/mahara/master/htdocs/lib/errors.php:439
error(8, "Array to string conversion", "/home/sonn/code/mahara/master/htdocs/lib/adodb/ado...", 43, array(size 7)) at /home/sonn/code/mahara/master/htdocs/lib/adodb/adodb-exceptions.inc.php:43
ADODB_Exception->__construct("postgres7", "adodb_throw", -1, "ERROR: invalid input syntax for type timestamp: "...", "INSERT INTO "mh11_artefact" ("id", "artefacttype",...", array(size 10), object(ADODB_postgres7)) at /home/sonn/code/mahara/master/htdocs/lib/adodb/adodb-exceptions.inc.php:78
adodb_throw("postgres7", "adodb_throw", -1, "ERROR: invalid input syntax for type timestamp: "...", "INSERT INTO "mh11_artefact" ("id", "artefacttype",...", array(size 10), object(ADODB_postgres7)) at /home/sonn/code/mahara/master/htdocs/lib/adodb/adodb.inc.php:257
ADODB_TransMonitor("postgres7", "EXECUTE", -1, "ERROR: invalid input syntax for type timestamp: "...", "INSERT INTO "mh11_artefact" ("id", "artefacttype",...", array(size 10), object(ADODB_postgres7)) at /home/sonn/code/mahara/master/htdocs/lib/adodb/adodb.inc.php:1074
ADOConnection->_Execute("INSERT INTO "mh11_artefact" ("id", "artefacttype",...", array(size 10)) at /home/sonn/code/mahara/master/htdocs/lib/adodb/adodb.inc.php:1045
ADOConnection->Execute("INSERT INTO "mh11_artefact" ("id", "artefacttype",...", array(size 10)) at /home/sonn/code/mahara/master/htdocs/lib/dml.php:1043
insert_record("artefact", object(stdClass), "id", true) at /home/sonn/code/mahara/master/htdocs/artefact/lib.php:548
ArtefactType->commit() at /home/sonn/code/mahara/master/htdocs/artefact/blog/lib.php:154
ArtefactTypeBlog->commit() at /home/sonn/code/mahara/master/htdocs/import/leap/lib.php:2207
LeapImportArtefactPlugin::create_artefact_from_request(object(PluginImportLeap), object(stdClass)) at /home/sonn/code/mahara/master/htdocs/artefact/blog/import/leap/lib.php:175
LeapImportBlog::import_from_requests(object(PluginImportLeap)) at Unknown:0
call_user_func_array(array(size 2), array(size 1)) at /home/sonn/code/mahara/master/htdocs/lib/mahara.php:1577
call_static_method("LeapImportBlog", "import_from_requests", object(PluginImportLeap)) at /home/sonn/code/mahara/master/htdocs/import/leap/lib.php:293
PluginImportLeap->call_import_method_plugins("import_from_requests") at /home/sonn/code/mahara/master/htdocs/import/leap/lib.php:308
PluginImportLeap->do_import_from_requests() at /home/sonn/code/mahara/master/htdocs/import/index.php:312
do_import() at /home/sonn/code/mahara/master/htdocs/import/index.php:75

The leap2a file is provided in the bug https://bugs.launchpad.net/mahara/+bug/1358934

Tags: import leap2a
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3661

Changed in mahara:
status: Confirmed → In Progress
importance: Undecided → Medium
milestone: none → 15.04.0
assignee: nobody → Son Nguyen (ngson2000)
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 15.04.0 → 15.04.1
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Son,

Can you please provide testing instructions? The test Leap2A file on https://bugs.launchpad.net/mahara/+bug/1358934 doesn't include any journal entries.

Thanks
Kristina

Revision history for this message
Robert Lyon (robertl-9) wrote :

Here is a way to test this patch:

1) User creates some blog entries

2) User exports their full portfolio via Leap2A

3) Manually edit the leap2a.xml file that was exported and deleted the <updated></updated> and <published></published> lines for one of the blog entries

In doing this we can mimic what would happen for non-Mahara data being imported - entries in Leap2A that Mahara doesn't understand get imported as blog entries

4) Import the altered Leap2A again
 - before patch get the errors
 - after patch the import should be fine

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3661
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/4761fa4591ab750fcfdb634f829ee1f9efa1805b
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 4761fa4591ab750fcfdb634f829ee1f9efa1805b
Author: Son Nguyen <email address hidden>
Date: Mon Aug 25 16:05:07 2014 +1200

Setup the default values from ctime and mtime (Bug 1360977)

That fix the issue when importing an blog with no published and updated
time

behatnotneeded

Change-Id: I4cfca0f212b2e3f160d043c23c9155043607960d
Signed-off-by: Son Nguyen <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/5522

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5522
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/8b893b444311c7509f69d5ce76df554c64a0fa95
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit 8b893b444311c7509f69d5ce76df554c64a0fa95
Author: Son Nguyen <email address hidden>
Date: Mon Aug 25 16:05:07 2014 +1200

Setup the default values from ctime and mtime (Bug 1360977)

That fix the issue when importing an blog with no published and updated
time

behatnotneeded

Change-Id: I4cfca0f212b2e3f160d043c23c9155043607960d
Signed-off-by: Son Nguyen <email address hidden>
(cherry picked from commit 4761fa4591ab750fcfdb634f829ee1f9efa1805b)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5523

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "1.10_STABLE" branch: https://reviews.mahara.org/5524

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5524
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/f928cf31a2f643e1067eeea42d65b82ac14c5e6c
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.10_STABLE

commit f928cf31a2f643e1067eeea42d65b82ac14c5e6c
Author: Son Nguyen <email address hidden>
Date: Mon Aug 25 16:05:07 2014 +1200

Setup the default values from ctime and mtime (Bug 1360977)

That fix the issue when importing an blog with no published and updated
time

behatnotneeded

Change-Id: I4cfca0f212b2e3f160d043c23c9155043607960d
Signed-off-by: Son Nguyen <email address hidden>
(cherry picked from commit 4761fa4591ab750fcfdb634f829ee1f9efa1805b)
(cherry picked from commit 8b893b444311c7509f69d5ce76df554c64a0fa95)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5523
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/b95c935c0f1c0163283a4439d89ace11a315897d
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit b95c935c0f1c0163283a4439d89ace11a315897d
Author: Son Nguyen <email address hidden>
Date: Mon Aug 25 16:05:07 2014 +1200

Setup the default values from ctime and mtime (Bug 1360977)

That fix the issue when importing an blog with no published and updated
time

behatnotneeded

Change-Id: I4cfca0f212b2e3f160d043c23c9155043607960d
Signed-off-by: Son Nguyen <email address hidden>
(cherry picked from commit 4761fa4591ab750fcfdb634f829ee1f9efa1805b)
(cherry picked from commit 8b893b444311c7509f69d5ce76df554c64a0fa95)

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.