On fresh drupal68 install, installed 6.x-1.0-rc2, any import/export functions result in:

Parse error: parse error, expecting `')'' in /Library/WebServer/Documents/drupal68/sites/all/modules/biblio/biblio.import.export.inc on line 282

Also happens in -rc1, and most recent -dev, but not in beta9. Tried running some diffs, but could spot the problem.

Any suggestions?

Comments

rjerome’s picture

That's bizarre! I use import ALL the time, that's how I test most functions.

I would need more info on your setup (Web server, OS, PHP version etc) and perhaps I could shed some light on it.

That line should look like this... (does it on your end?)

function biblio_import($import_file, $type, $userid = 1, $terms = NULL, $batch = FALSE, $id = NULL, &$context = NULL) {

wehall’s picture

Yes, it is bizarre.

On OS X 10.4, apache 1.3.41, php 4.4.9, drupal 6.8 (empty biblio db), I get the error.
On RHEL 4u7, apache 2.0.52, php 4.3.9, drupal 6.6 (biblio db with ~500 entries), I get an empty browser

My line 282 looks as you describe.

Moving that function to the top of the file, the error follows it, so perhaps a missing ')' before an include?

rjerome’s picture

Hmmm, I've run this on a number of different platforms as well and not encountered that errror, the only difference being I'm using PHP 5.x. Have you tried PHP 5.x? Is there some reason you have to stay with 4.x?

The only other thing I can think of is a file formatting issue (i.e. carriage return/linefeeds as opposed to just linefeeds)

Ron.

ju_wien’s picture

Same error here, on Debian Etch, Apache 2.2, PHP 4.4.4-8+etch6, Drupal 6.8, Biblio 6.x-1.0-rc2. The reason why I stay with PHP4 is that the last time I tried to change to PHP5, a lot of things didn't work afterwords. (This may well have been *my* mistake but I have to little experience to find out.)

Arminius’s picture

Maybe it is really a PHP 4 issue? I can confirm the following:

I run Drupal 6 with this fantastic module (thanks by the way!!) on two different servers.

Server (1) has PHP 5.2.6
Server (2) has PHP 4.4.8

Importing works fine on the PHP 5 server, but I got the same error (mentioned above) on the PHP4 installation.

rjerome’s picture

OK, it looks like I need to test with PHP 4.x although given that 4.x was "End of Lifed" (http://www.php.net/downloads.php#v4) in Dec. 2007 people really should be thinking of upgrading by now :-)

Arminius’s picture

Okay, I was curious. I just changed on the Server (2) [see my posting #5] from PHP 4 to PHP 5.2.5 and I confirm, that the import works now without this error!

rjerome’s picture

It seems that in PHP 4 you can't set the default value of a variable passed by reference, so removing the "= NULL" from the last argument on line 287 fixes the problem...

changing...

function biblio_import($import_file, $type, $userid = 1, $terms = NULL, $batch = FALSE, $id = NULL, &$context = NULL ) {

to....

function biblio_import($import_file, $type, $userid = 1, $terms = NULL, $batch = FALSE, $id = NULL, &$context ) {

solves the problem.

Ron.

ju_wien’s picture

thank you!

rjerome’s picture

Your thank you may be a bit premature in that this is just the first in a number of PHP4 compatibilities.

Stay tuned...

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.