Downloaded the new dev (March 20, 2010), still can't get past step 7. Get this error:
Fatal error: Only variables can be passed by reference in /home/.halloween/jlud/artn.pmcarlson.com/dev/sites/all/modules/node_import/node_import.inc on line 668
Same error I get with the official release (6.x-1.0-rc4). (Might be a different line number, can't remember.)
Using Firefox on Win Vista.
(Did a search for 668, didn't see this posted yet. Apologies if it's already on the list.)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | node_import-passbyreference-748198-7.patch | 1.15 KB | richardsmart |
Comments
Comment #1
crashtest_ commentedI am also getting this error, after using latest CVS 6 version.
Comment #2
Robrecht Jacques commentedWhat is your PHP version?
Comment #3
boabjohn commentedG'Day Robrecht,
I just came across this as well. On the latest dev (23-08-2010) and running:
MySQL database 5.0.51a
PHP 5.2.6-1+lenny4
PHP memory limit 256M
Strangely, the import worked first time. I needed to improve a couple of columns, so I deleted all my imported nodes and then tried another import with the slightly improved file...then got the line 668 error above.
Can I supply more info to help with troubleshooting?
Comment #4
nruest commentedI am also getting this error. My php version is: PHP 5.2.14-0 & MySQL version 5.1.49.
The odd thing is that the module was working just fine for me last time I did an import, which was about 2 months ago.
Comment #5
boabjohn commentedAre these issues related? >> http://drupal.org/node/422322#comment-3583794
My error is also on line 668.
PHP has 196M on mod_php (apache)
Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0
On my site I also had success with an early version of the node and content. Since then I have added more fields and changed the data (no way to roll back), BUT as noted in the comment linked above I have mapped all data except the Title field to 'none' and am still getting the error.
Where to turn next?
Comment #6
richardsmart commentedYes, the two issues appear to be related. You can fix this problem with a version of #20 from http://drupal.org/node/422322
It's a problem since php 5.0.5 (see http://drupal.org/node/32881):
Isn't right, because foo wants a variable (as it should be a reference), but bar returns a string.
So on line 668 of node_import.inc, $function is one of the node_import_check_boolean / node_import_check_date / node_import_check_email etc functions which expect the first parameter to be a
variable. $values[$fieldname][$i] is a string in a number of cases.
Replacing the line (668):
$return = $function($values[$fieldname][$i], $fieldinfo, $options[$fieldname], $preview);
with:
$return = $function($var = $values[$fieldname][$i], $fieldinfo, $options[$fieldname], $preview);
on the latest dev version appears to fix it (however, I am unsure if it is the correct way), and I'm now getting other errors (but am unsure if it's to do with my change or not). I'll give more feedback if I make any more progress.
Comment #7
richardsmart commentedusing #20 from http://drupal.org/node/422322 seems to be the best option to me. The code at line 668 should read:
Hope that helps,
Rich
Comment #8
richardsmart commentedHere's a patch to the effect of #7 above. Not sure if I should have marked this as duplicate and added the patch to http://drupal.org/node/422322 ? It seems like the code has updated since then, so attached it to this issue.
This in effect is a re-run of http://drupal.org/node/422322 #21, but with #22 taken into consideration, and with the latest code (whereby the error is on line 668)
Comment #9
richardsmart commentedupdating title to better reflect issue
updating priority to reflect priority guide (http://drupal.org/node/45111)
Comment #10
pazcu commentedRichard,
thank you so much for this patch! I had the same issue on line 666, but your patch worked like a gem...
Comment #11
mynameispj commentedJust wanted to say that I also ran into this problem on line 666, and Richard's patch on #8 did the trick.