I'm getting this on the "Import content" page at the top of the page before beginning an import.

Warning: Call-time pass-by-reference has been deprecated in /home/path_to/modules/node_import/node_import.inc on line 1971

The patch in http://drupal.org/node/763036 to "make things compatible" with PHP 5.3 explicitly call for variables to be passed by reference? Not sure if this is the only place this was introduced, but it has been deprecated so it isn't a lasting viable solution.

Comments

Robrecht Jacques’s picture

What version of PHP is this?

mjvesper’s picture

PHP Version 5.2.15

Unless PHP is explicitly set to allow it (and being deprecated, many configs may have it off in PHP 5.x) using the directive allow_call_time_pass_reference = On, this error will come up.

Robrecht Jacques’s picture

Status: Active » Needs review

Does following patch work?

diff --git a/node_import.inc b/node_import.inc
index 0d56314..b826682 100644
--- a/node_import.inc
+++ b/node_import.inc
@@ -1970,7 +1970,8 @@ function node_import_write_to_string($values, $file_options) {
  */
 function node_import_drupal_execute($form_id, &$form_state) {
   $args = func_get_args();
-  $form = call_user_func_array('drupal_retrieve_form', &$args);
+  $args[1] = &$form_state;
+  $form = call_user_func_array('drupal_retrieve_form', $args);
   $form['#post'] = $form_state['values'];
   $form_state['must_validate'] = TRUE;
   drupal_prepare_form($form_id, $form, $form_state);
mjvesper’s picture

I may be wrong, but isn't this just adding another reference?

+ $args[1] = &$form_state;

bt82’s picture

this worked for me, thanks.

Robrecht Jacques’s picture

@mjvesper: no the important part is that the variable "$args" is no longer passed as "&$args".

The code is btw copied from drupal_execute() which node_import_drupal_execute() is a wrapper to.

Alaska’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

Same issue showed up for PHP 5.2.11. Same fix worked.

mjvesper’s picture

@Robrecht Jacques - Gotcha...

Thanks for the patch.

Robrecht Jacques’s picture

Version: 6.x-1.x-dev » 6.x-1.0
Status: Needs review » Reviewed & tested by the community
brandonratz’s picture

Patch confirmed working for PHP 5.2.11

ianchan’s picture

subscribe

jetxs’s picture

subscribe

hobo’s picture

patch worked for me.

Robrecht Jacques’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 6.x-1.x (-dev), will be included in 6.x-1.1 release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

escoles’s picture

FYI, important to fix this / apply the patch on your installations, as it appears that this can take down the Apache process on some server configurations and can be triggered when taking ordinary actions having absolutely nothing to do with the Node Import module. Viz the following error message from the server logfile:

[Mon Apr 18 10:31:10 2011] [error] [client 24.103.213.26] PHP 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 call_user_func_array(). 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 /var/www/vhosts/DOMAIN.com/httpdocs/sites/all/modules/node_import/node_import.inc on line 1971, referer: http://demo.DOMAIN.com/admin/build/block

The error was triggered by editing & saving a block.

I can somewhat reliably make the server go offline on my client's NetSol VPS (PHP 5.1, which is standard for a NetSol VPS, and no you can't really upgrade them). It looks like maybe 1 block edit in 5 will crash Apache.