Updated: Comment #10

Problem/Motivation

Hi,
I have installed Sheetnode and when I tried to import an .xls or .ods file, i get this error:

        An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /?q=batch&id=45&op=do StatusText: Service unavailable (with message) ResponseText: Exception: Serialization of 'SimpleXMLElement' is not allowed in serialize() (on /home/upf8uk22/domains/arsmediasrl.it/public_html/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc line 110).

Please, help me to fix this.
Orazio

Proposed resolution

Document properties being kept in XML format instead of plain text. We could:
1. Handle this with sheetnode or
2. Submit a patch to PHPExcel

CommentFileSizeAuthor
#6 test.ods18.4 KBancym
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rafael Alquezar’s picture

Title: Errot to .xls and .ods import » Error to .xls and .ods import
Component: Core » Import/Export

I have the same problem, read about PHP memory limit and max time limit expanding but I couldn't do it.
http://drupal.org/node/1183412 this post seens to show other solution, but i couldn't understand it too.

Thanks.

infojunkie’s picture

Is this for a specific XLS or for all of them?

grn’s picture

Hi.

This looks like the paths for the libraries are not defined.

ancym’s picture

Hi I also have this error when attempting to import ods file -

Exception: Serialization of 'SimpleXMLElement' is not allowed in serialize() (line 110 of /var/www/html/drupal-7.22/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc).

Refers here:
function _sheetnode_phpexcel_batch_import_file($filename, $filepath, $callback, $params, &$context) {
module_load_include('inc', 'node', 'node.pages');
set_time_limit(0);
global $user;

if (empty($context['sandbox']['workbook'])) {
// Load workbook and get number of worksheets.
$workbook = PHPExcel_IOFactory::load($filepath);
$context['sandbox']['workbook'] = serialize($workbook);
$context['sandbox']['total'] = $workbook->getSheetCount();
$context['sandbox']['current'] = 0;
$context['sandbox']['filename'] = $filename;
}

For the record, I am able to import xls files (although with formula errors, but that is another issue...)
As you can no doubt tell, I have no idea where to go from here. Thanks for the module which is not quite usable for me so far, but I am hopeful...

Here is it, infojunkie, and thanks for your help - the file attached worked fine as an xls file but when saved as ods and imported generated the error msg above.
(editing comments behaving strangely here today)

infojunkie’s picture

ancym, can you please attach the offending .ods file here? I am unable to reproduce this.

ancym’s picture

Issue summary: View changes
FileSize
18.4 KB
infojunkie’s picture

Thanks, this file shows the error for me too :-)

infojunkie’s picture

I found the problem to originate from the PHPExcel library, which keeps some document properties in XML format instead of converting them to plain text. I need to think about the best approach to fix this: handle it in Sheetnode or submit a patch to PHPExcel? Will update this thread.

areke’s picture

Issue summary: View changes
areke’s picture

Issue summary: View changes

Use summary template

infojunkie’s picture

Submitted pull request to PHPExcel library. Will also try to find a way to guard against errors on the Sheetnode side.

infojunkie’s picture

Assigned: ovazzzio » Unassigned
Category: Support request » Bug report
Priority: Critical » Normal
infojunkie’s picture

Status: Active » Fixed

Pull request to PHPExcel was accepted and merged into their develop branch. Although it may be a while until the new official PHPExcel version features this fix, marking this issue as fixed.

No change in this module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.