Hi folks!

I'm getting a bunch of error messages after upgrading my php installation to the new 5.3.2 and using Drupal 6.16.

The new PHP update deprecates some stuff, like safe_mode or "Assigning the return value of new by reference is now deprecated". -> (http://de.php.net/manual/de/migration53.deprecated.php) I'm not a php programmer, but the following issue warns me that there's something broken:

Error message

warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in 
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
 /var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
 /var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
 /var/www/blog/includes/common.inc on line 2839.
warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in 
/var/www/blog/includes/common.inc on line 2839.

common.inc or modules

The code that is responsible for these warnings (yes, so many) is:

foreach (module_implements($type .'_alter') as $module) {
    $function = $module .'_'. $type .'_alter';
        call_user_func_array($function, $args);
   }

I don't know too much about php, because academia tortured me with Java, C++ and stuff. Is this a issue from my installed modules?
- If that is: my site works fine.

How do I deactivate the annoying warning. Because I don't really care about php.
As ignorant as it might sound: this bothers users and not me ;).

Thanks,
Marius

Comments

DoctorWho’s picture

You'll find some info on changing the error reporting on the following site, you'll have to change your php.ini:

http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-repor...

I would not use php 5.3 yet as some modules still have problems, but if everything you need works, fine. Just be careful if you need to install additional modules. Personally, I would downgrade php, if possible, but that's your choice.

wishinet’s picture

error_reporting = 0
display_errors = "E_ERROR"

Normally this would only show fatal runtime errors according to documentation. It seems however the error messages stay persistently annoying.

Downgrading php however can only be temporary option, either. So I'd try to avoid that for now, relying on somebody who knows how to deactivate that :)

francisconi.org’s picture

I solved this problem by following the instructions of the Mrt. cesarkohl

1. find where's content_copy_form_alter()
2. it's here! /cck/modules/content_copy/content_copy.module
3. open and find the function content_copy_form_alter(). It's like that:
function content_copy_form_alter(&$form, &$form_state, $form_id)
4. delete the two ampersands
function content_copy_form_alter($form, $form_state, $form_id)

Please read

http://drupal.org/node/710892#comment-2709534

do not touch anything in the php.ini configuration

pardon my English (not English)

nix386’s picture

securepages_form_alter(&$form, &$form_state, $form_id)

delete the two ampersands function securepages_form_alter($form, $form_state, $form_id)

Nick

scb’s picture

Don't do that...
Those params are references, and expected to be changed inside the function. If you turn them into values, it won't work.
http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...

jm.federico’s picture

@scb

PHP 5.3 does not requires the & to pass arguments by reference.
You can safely remove the ampersands if you are using PHP >5.3

dereks8443’s picture

Perhaps if someone creates a new "Issue" (aka bug report) with this info, the module devs can prioritize it and fix it.

By the way... what kind of node is this? I found this node using Google. How was it created? It's not an "Issue" node because it doesn't show the priority or status information...?

vm’s picture

it's a forum post

jm.federico’s picture

Guys

Please open issues with the corresponding modules in order for those warnings to be fixed.

The one for this specific post:

warning: Parameter 2 to securepages_link_alter() expected to be a reference, value given in
/var/www/blog/includes/common.inc on line 2839.

Has been fixed in the DEV release of securepages http://drupal.org/project/securepages

Cheers

Mark B’s picture

The current stable 6.x version of securepages is dated May 2009. I'm a bit nervous about installing a dev version of such a critical module when the stable release is so much older...

_snake_’s picture

Subscribe

jwilson3’s picture

You can see this has been reported various times in the SecurePages issue queue, and I just wanted to update this thread with the latest status:

The 5.3 compatibility issue has been partially addressed in the latest version of SecurePages module version 6.x-1.9 as a result of the patch first provided in #600106: Parameters passed by value instead of reference.

However, there is still an outstanding issue that I uncovered in 6.x-1.8 that did not make it into this version.

Additional eyes on this issue would be appreciated, where I've rerolled the patch for SecurePages 6.x-1.9: #1038126: Bad function signature: hook_links_alter