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.
While running PHP5.3, I noticed the above error message when trying to import a csv file into table wizard. Because of this the import fails. It looks like another one of those ref, value strictness bugs in PHP5.3.
Here's a rather simple change that seems to work on my box.
change in tw_import_delimited.module
function _tw_import_delimited_import_file(&$srcinfo, &$context) {
if (!isset($context['sandbox']['total'])) {
$context['sandbox']['total'] = filesize($srcinfo->filepath);
$context['sandbox']['done'] = $srcinfo->offset;
$context['sandbox']['rows'] = 0;
}
to
function _tw_import_delimited_import_file($srcinfo, &$context) {
if (!isset($context['sandbox']['total'])) {
$context['sandbox']['total'] = filesize($srcinfo->filepath);
$context['sandbox']['done'] = $srcinfo->offset;
$context['sandbox']['rows'] = 0;
}
Comments
Comment #1
adam_b CreditAttribution: adam_b commentedConfirm that I was having the same problem - tried the dev version but it didn't help. This change appears to have solve it - thanks :)
Comment #2
mikeryanCommitted, thanks!
Comment #4
verta CreditAttribution: verta commentedWorked for me too.
Not sure what the release schedule is, but it's been a couple of months. Hosts are starting to deploy PHP 5.3, the sooner this gets out of dev and into a main release, the fewer people will be hitting this fixed bug and have to use a dev release to work around it.
Comment #5
pgvalcke CreditAttribution: pgvalcke commentedThis worked fine for me ! thanks