Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comments
Comment #1
Rafael Alquezar CreditAttribution: Rafael Alquezar commentedI 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.
Comment #2
infojunkieIs this for a specific XLS or for all of them?
Comment #3
grn CreditAttribution: grn commentedHi.
This looks like the paths for the libraries are not defined.
Comment #4
ancym CreditAttribution: ancym commentedHi 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)
Comment #5
infojunkieancym, can you please attach the offending .ods file here? I am unable to reproduce this.
Comment #6
ancym CreditAttribution: ancym commentedComment #7
infojunkieThanks, this file shows the error for me too :-)
Comment #8
infojunkieI 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.
Comment #9
areke CreditAttribution: areke commentedComment #10
areke CreditAttribution: areke commentedUse summary template
Comment #11
infojunkieSubmitted pull request to PHPExcel library. Will also try to find a way to guard against errors on the Sheetnode side.
Comment #12
infojunkieComment #13
infojunkiePull 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.