After installing Project 4.7.0 on Drupal 4.7.2, every time I hit project page I see this error:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.dowdiddie/[...]/drupal/modules/project/project.module on line 520

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.dowdiddie/[...]/drupal/modules/project/project.module on line 523

I think its about incompatibility with PHP5.

CommentFileSizeAuthor
#6 project_php5_stray_ampersand.patch813 bytesdww

Comments

Nick Wilson’s picture

Priority: Normal » Critical

I tried this in php.ini

allow_call_time_pass_reference = true

but it does not solve the problem, where it clearly should do right?

Nick Wilson’s picture

added, also tried that as 'On' instead of 'true' of course.

nicholasthompson’s picture

In the .htaccess file in your drupal folder, I added this line:
php_value allow_call_time_pass_reference 1

to all 3 PHP IfModule sections (just under php_value session.auto_start)

Problem solved :-)

dandaka’s picture

I've tried to edit .htaccess like this:

<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value allow_call_time_pass_reference 1
</IfModule>

Also I've tried to do so with sites/default/settings.php

ini_set('allow_call_time_pass_reference', 1);

Negative result for me. Am I wrong somewhere?

eafarris’s picture

From the looks of things (I haven't tested this, mind you), you should be able to simply remove the ampersands from those lines.

Line 520 should look like:

project_project_nodeapi($node, $op, $arg);

and line 523 should look like:

project_issue_nodeapi($node, $op, $arg);

Note the missing ampersand from "$node" in both of them. I can roll a patch if need be, but that should do it. The function definitions for both project_project_nodeapi (in project.inc) and project_issue_nodeapi (in issue.inc) expect $node to be passed by reference, so the ampersands in project.module lines 520 and 523 are superfluous.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new813 bytes

yup. just tested this on a php5 site, and those stray '&'s are the problem. sorry about that.
here's a patch to fix it. however, i'm not going to commit immediately, since i'm in the middle of a major code re-organization in http://drupal.org/node/74995. once that's done, i'll just commit this fix. only posting the patch so it's easy for php5 users to patch their system in the meantime. sorry for the delay.

dandaka’s picture

thanks, worked for me

dww’s picture

Status: Needs review » Fixed

committed to HEAD, DRUPAL-4-7 and DRUPAL-4-6. note: 1/2 of the code in this patch now lives in modules/project_issue/project_issue.module. i had already applied the fixes there.

Anonymous’s picture

Status: Fixed » Closed (fixed)