Importing xml error

Hi, I have a host with OJS 2.4.7, and when I try to import a number in XML from other host OJS too, showme this error:

Fatal error: Call to a member function addChild() on a non-object in /var/www/html/lib/pkp/classes/xml/XMLCustomWriter.inc.php on line 86

thanks for you help.

Hi @mimolore,

Can you turn on show_stacktrace in your config.inc.php configuration file and try again? This should provide more debugging information.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec, I did that you suggested but the error persists.

; Display a stack trace when a fatal error occurs.
; Note that this may expose private information and should be disabled
; for any production system.
show_stacktrace = On

thanks for help.

Hi @mimolore,

Can you confirm that the error appears exactly the same way? The stack trace option should add new information alongside the same message.

If not, would you be willing to share your XML with me? If so, send me a private message.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello, is the same error Alec. No problem, so tellme how I do to send you
the private message. Thanks

Hi @mimolore,

You should be able to click on my username, then click “Message”.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @mimolore,

I tested importing the XML into my local OJS 2.4.8 install and it worked fine; the XML looks good to me, and I can’t tell where your installation is running into trouble.

The error message you report would be caused by an export, not an import, so I suspect it’s not related to the problem you’re encountering. Can you double-check that nothing else appears in your error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello, Look the printscreen. thanks

Hi @mimolore,

Are you sure there have been no modifications to the installation? Looking at the code I’m not sure what would cause this.

If I were debugging this, I would add the following to the start of XMLCustomWriter::appendChild:

if (!is_object($parentNode)) fatalError('Non-object $parentNode.');

With show_stacktrace turned on, this ought to give more information.

Regards
Alec Smecher
Public Knowledge Project Team

Hi, Alec: where I do the modification?. Thanks for help.

function &appendChild(&$parentNode, &$child) {
if (is_callable(array($parentNode, ‘appendChild’))) $node =& $parentNode->appendChild($child);
else {
$parentNode->addChild($child);
$child->setParent($parentNode);
$node =& $child;
}

	return $node;

As I have already mentioned, the installation in virtual server does not generate problems. but in the CENTOS server, yes . Thanks for the help.

Hi @mimolore,

It needs to go at the very start of the function.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec, Hi Alec , I did that you suggested and the problem was with the plugin lucene that prevented me import. For your help thanks a lot. But now I have this problem :

Warning: POST Content-Length of 8568406 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

It´s a problem with php?. thanks

1 Like

Hi @mimolore,

That’s a PHP configuration issue. See the post_max_size directive in config.inc.php.

(Are you sure this is related to the Lucene plugin? I’m not sure how that’s involved.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec, now I have this problem, when i try to import a issue:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 38098204 bytes) in /var/www/html/plugins/importexport/native/NativeImportDom.inc.php on line 360

thanks for help.

Hi @mimolore,

This is also a PHP configuration issue; see e.g. http://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter-xml.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Ale, Sorry so many questions but i have now this error when i try import:

DB Error: Duplicate entry ‘235-106’ for key ‘custom_section_orders_pkey’

Stack Trace:

File: /var/www/html/classes/journal/SectionDAO.inc.php line 622
Function: DAO->update(“INSERT INTO custom_section_orders (section_id, issue_id, seq) VA…”, Array(3))

File: /var/www/html/plugins/importexport/native/NativeImportDom.inc.php line 627
Function: SectionDAO->insertCustomSectionOrder(“235”, “106”, 2)

File: /var/www/html/plugins/importexport/native/NativeImportDom.inc.php line 287
Function: NativeImportDom->handleSectionNode(Object(Journal), Object(XMLNode), Object(Issue), Array(0), Object(User), False, Array(8), 2)

File: /var/www/html/plugins/importexport/native/NativeImportExportPlugin.inc.php line 312
Function: NativeImportDom->importIssue(Object(Journal), Object(XMLNode), Object(Issue), Array(0), Object(User), False, Array(8))

File: /var/www/html/plugins/importexport/native/NativeImportExportPlugin.inc.php line 179
Function: NativeImportExportPlugin->handleImport(Array(2), Object(XMLNode), Array(0), Array(0), Array(0), False)

File: /var/www/html/pages/manager/ImportExportHandler.inc.php line 43
Function: NativeImportExportPlugin->display(Array(0), Object(Request))

File: (unknown) line (unknown)
Function: ImportExportHandler->importexport(Array(3), Object(Request))

File: /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php line 362
Function: call_user_func(Array(2), Array(3), Object(Request))

File: /var/www/html/lib/pkp/classes/core/PKPPageRouter.inc.php line 220
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(3), False)

File: /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php line 134
Function: PKPPageRouter->route(Object(Request))

File: /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php line 178
Function: Dispatcher->dispatch(Object(Request))

File: /var/www/html/index.php line 64
Function: PKPApplication->execute()

thanks for your help again.

Hi @mimolore,

Have a look at this thread:
http://forum.pkp.sfu.ca/t/import-journal-to-multijournal-server

Regards,
Alec Smecher
Public Knowledge Project Team