Warnings when importing user

Bug #1242218 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

1.8.0RC3dev

Importing a user's full Leap2A file as admin throws following warnings (file can be provided):

[WAR] 81 (artefact/blog/import/leap/lib.php:570) Undefined variable: blogentryid
Call stack (most recent first):

    log_message("Undefined variable: blogentryid", 8, true, true, "/home/kristina/code/18stable/htdocs/artefact/blog/...", 570) at /home/kristina/code/18stable/htdocs/lib/errors.php:430
    error(8, "Undefined variable: blogentryid", "/home/kristina/code/18stable/htdocs/artefact/blog/...", 570, array(size 3)) at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:570
    LeapImportBlog::create_blogpost(object(SimpleXMLElement), object(PluginImportLeap), "portfolio:artefact178") at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:214
    LeapImportBlog::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at Unknown:0
    call_user_func_array(array(size 2), array(size 4)) at /home/kristina/code/18stable/htdocs/lib/mahara.php:1449
    call_static_method("LeapImportBlog", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at /home/kristina/code/18stable/htdocs/import/leap/lib.php:631
    PluginImportLeap->import_from_load_mapping() at /home/kristina/code/18stable/htdocs/import/leap/lib.php:159
    PluginImportLeap->process() at /home/kristina/code/18stable/htdocs/admin/users/add.php:329
    adduser_submit(object(Pieform), array(size 26)) at Unknown:0
    call_user_func_array("adduser_submit", array(size 2)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:528
    Pieform->__construct(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:170
    Pieform::process(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 7)) at /home/kristina/code/18stable/htdocs/admin/users/add.php:148

[WAR] 81 (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/kristina/code/18stable/htdocs/lib/adodb/adod...", 43) at /home/kristina/code/18stable/htdocs/lib/errors.php:430
    error(8, "Array to string conversion", "/home/kristina/code/18stable/htdocs/lib/adodb/adod...", 43, array(size 7)) at /home/kristina/code/18stable/htdocs/lib/adodb/adodb-exceptions.inc.php:43
    ADODB_Exception->__construct("postgres7", "adodb_throw", -1, "ERROR: invalid input syntax for integer: "portfol...", "INSERT INTO "artefact" ("id", "artefacttype", "par...", array(size 11), object(ADODB_postgres7)) at /home/kristina/code/18stable/htdocs/lib/adodb/adodb-exceptions.inc.php:78
    adodb_throw("postgres7", "adodb_throw", -1, "ERROR: invalid input syntax for integer: "portfol...", "INSERT INTO "artefact" ("id", "artefacttype", "par...", array(size 11), object(ADODB_postgres7)) at /home/kristina/code/18stable/htdocs/lib/adodb/adodb.inc.php:257
    ADODB_TransMonitor("postgres7", "EXECUTE", -1, "ERROR: invalid input syntax for integer: "portfol...", "INSERT INTO "artefact" ("id", "artefacttype", "par...", array(size 11), object(ADODB_postgres7)) at /home/kristina/code/18stable/htdocs/lib/adodb/adodb.inc.php:1074
    ADOConnection->_Execute("INSERT INTO "artefact" ("id", "artefacttype", "par...", array(size 11)) at /home/kristina/code/18stable/htdocs/lib/adodb/adodb.inc.php:1045
    ADOConnection->Execute("INSERT INTO "artefact" ("id", "artefacttype", "par...", array(size 11)) at /home/kristina/code/18stable/htdocs/lib/dml.php:1050
    insert_record("artefact", object(stdClass), "id", true) at /home/kristina/code/18stable/htdocs/artefact/lib.php:435
    ArtefactType->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/lib.php:501
    ArtefactTypeBlogPost->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:607
    LeapImportBlog::create_blogpost(object(SimpleXMLElement), object(PluginImportLeap), "portfolio:artefact178") at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:214
    LeapImportBlog::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at Unknown:0
    call_user_func_array(array(size 2), array(size 4)) at /home/kristina/code/18stable/htdocs/lib/mahara.php:1449
    call_static_method("LeapImportBlog", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at /home/kristina/code/18stable/htdocs/import/leap/lib.php:631
    PluginImportLeap->import_from_load_mapping() at /home/kristina/code/18stable/htdocs/import/leap/lib.php:159
    PluginImportLeap->process() at /home/kristina/code/18stable/htdocs/admin/users/add.php:329
    adduser_submit(object(Pieform), array(size 26)) at Unknown:0
    call_user_func_array("adduser_submit", array(size 2)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:528
    Pieform->__construct(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:170
    Pieform::process(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 7)) at /home/kristina/code/18stable/htdocs/admin/users/add.php:148

[WAR] 81 (lib/errors.php:736) Failed to get a recordset: postgres7 error: [-1: ERROR: invalid input syntax for integer: "portfolio:artefact178"] in adodb_throw(INSERT INTO "artefact" ("id", "artefacttype", "parent", "owner", "ctime", "mtime", "atime", "title", "description", "author", "allowcomments") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), Array)
Command was: INSERT INTO "artefact" ("id", "artefacttype", "parent", "owner", "ctime", "mtime", "atime", "title", "description", "author", "allowcomments") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (419,blogpost,portfolio:artefact178,10,2012-07-20T15:53:55+12:00,2012-10-07T10:32:47+13:00,2013-10-20 13:42:45,Portfolio presentation,<div><p>At last week's conference I presented on our use of ePortfolios. The session was well-attended and we had about 15 minutes for questions. The most important question in my opinion was...</p></div>,10,1)
Call stack (most recent first):

    log_message("Failed to get a recordset: postgres7 error: [-1: E...", 8, true, true) at /home/kristina/code/18stable/htdocs/lib/errors.php:93
    log_warn("Failed to get a recordset: postgres7 error: [-1: E...") at /home/kristina/code/18stable/htdocs/lib/errors.php:736
    SQLException->__construct("Failed to get a recordset: postgres7 error: [-1: E...") at /home/kristina/code/18stable/htdocs/lib/dml.php:1053
    insert_record("artefact", object(stdClass), "id", true) at /home/kristina/code/18stable/htdocs/artefact/lib.php:435
    ArtefactType->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/lib.php:501
    ArtefactTypeBlogPost->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:607
    LeapImportBlog::create_blogpost(object(SimpleXMLElement), object(PluginImportLeap), "portfolio:artefact178") at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:214
    LeapImportBlog::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at Unknown:0
    call_user_func_array(array(size 2), array(size 4)) at /home/kristina/code/18stable/htdocs/lib/mahara.php:1449
    call_static_method("LeapImportBlog", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at /home/kristina/code/18stable/htdocs/import/leap/lib.php:631
    PluginImportLeap->import_from_load_mapping() at /home/kristina/code/18stable/htdocs/import/leap/lib.php:159
    PluginImportLeap->process() at /home/kristina/code/18stable/htdocs/admin/users/add.php:329
    adduser_submit(object(Pieform), array(size 26)) at Unknown:0
    call_user_func_array("adduser_submit", array(size 2)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:528
    Pieform->__construct(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:170
    Pieform::process(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 7)) at /home/kristina/code/18stable/htdocs/admin/users/add.php:148

[WAR] 81 (lib/dml.php:1053) Failed to get a recordset: postgres7 error: [-1: ERROR: invalid input syntax for integer: "portfolio:artefact178"] in adodb_throw(INSERT INTO "artefact" ("id", "artefacttype", "parent", "owner", "ctime", "mtime", "atime", "title", "description", "author", "allowcomments") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), Array)
Command was: INSERT INTO "artefact" ("id", "artefacttype", "parent", "owner", "ctime", "mtime", "atime", "title", "description", "author", "allowcomments") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (419,blogpost,portfolio:artefact178,10,2012-07-20T15:53:55+12:00,2012-10-07T10:32:47+13:00,2013-10-20 13:42:45,Portfolio presentation,<div><p>At last week's conference I presented on our use of ePortfolios. The session was well-attended and we had about 15 minutes for questions. The most important question in my opinion was...</p></div>,10,1)
Call stack (most recent first):

    insert_record("artefact", object(stdClass), "id", true) at /home/kristina/code/18stable/htdocs/artefact/lib.php:435
    ArtefactType->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/lib.php:501
    ArtefactTypeBlogPost->commit() at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:607
    LeapImportBlog::create_blogpost(object(SimpleXMLElement), object(PluginImportLeap), "portfolio:artefact178") at /home/kristina/code/18stable/htdocs/artefact/blog/import/leap/lib.php:214
    LeapImportBlog::import_using_strategy(object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at Unknown:0
    call_user_func_array(array(size 2), array(size 4)) at /home/kristina/code/18stable/htdocs/lib/mahara.php:1449
    call_static_method("LeapImportBlog", "import_using_strategy", object(SimpleXMLElement), object(PluginImportLeap), 1, array(size 1)) at /home/kristina/code/18stable/htdocs/import/leap/lib.php:631
    PluginImportLeap->import_from_load_mapping() at /home/kristina/code/18stable/htdocs/import/leap/lib.php:159
    PluginImportLeap->process() at /home/kristina/code/18stable/htdocs/admin/users/add.php:329
    adduser_submit(object(Pieform), array(size 26)) at Unknown:0
    call_user_func_array("adduser_submit", array(size 2)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:528
    Pieform->__construct(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:170
    Pieform::process(array(size 7)) at /home/kristina/code/18stable/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 7)) at /home/kristina/code/18stable/htdocs/admin/users/add.php:148

Changed in mahara:
milestone: none → 1.8.0
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

same warnings come up when I try to import the user via Portfolio -> Import

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

Hi Kristina,

Well, looking at the top warning it is saying that there is no variable called $blogentryid - which is true as $blogid is passed into the function.

I've made a patch for that so that they both have same name now:
https://reviews.mahara.org/#/c/2624

Let me know if that fixes the issue (or if it just fixes the first error).

Cheers

Bob

Changed in mahara:
status: New → In Progress
assignee: nobody → Robert Lyon (robertl-9)
importance: Undecided → Medium
importance: Medium → High
Revision history for this message
Robert Lyon (robertl-9) wrote :

Marked the bug as 'high' due to it not saving things to db - which is bad

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

Ok the initial fix cleared up the first problem but the main problem still exists: It's not saving data correctly.

It looks to be the fact that a blogpost needs a 'parent' blog to atttach to and the code is supplying the parent id as 'portfolio:artefact178'
 - this is wrong on two accounts: 1) this is not an integer and 2) this is the id from the leap2a file and will not be the id of blogpost's parent blog in the db we are importing into.

What is needed is to get the artefact id of the 'parent' blog and use that integer.

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

Reviewed: https://reviews.mahara.org/2624
Committed: http://gitorious.org/mahara/mahara/commit/59825885bdc8237c3800922628057ab41a3caa07
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 59825885bdc8237c3800922628057ab41a3caa07
Author: Robert Lyon <email address hidden>
Date: Mon Oct 21 07:33:01 2013 +1300

Errors when importing leap2a blog (bug 1242218)

- error of undefinded variable $blogentryid
- error where the parent id given was leap2a id rather than db id

Change-Id: Ic00ac626e24fb158b1d4e9d074c114b47a4b8432
Signed-off-by: Robert Lyon <email address hidden>

Son Nguyen (ngson2000)
Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw)
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.