Hi. I just installed this module and turned it on and immediately go the following error message:

Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 933 of includes/bootstrap.inc)

CommentFileSizeAuthor
#13 collapse_text-call-by-ref.patch481 bytesliquidcms

Comments

cpelham’s picture

Category: support » bug

I didn't see an include in this module but I guess it's trying to load something and using the wrong syntax? I get these error messages on EVERY single page now so I'd really like to find a way to get rid of them.

pukku’s picture

THis is confusing, because the error is showing up in one of Drupal's functions, not one of this modules.

Could you try the dev version? There was a call-time pass-by-reference error that may have been fixed in a different place...

Ricky

cpelham’s picture

I found that upgrading to the dev version did not eliminate the error. but then surprisingly deactivating the module did not eliminate the error either, even though the error began with the activation of the module.

However, adding the following line to my .htaccess file eliminated the error messages:

php_flag allow_call_time_pass_reference on

Carlos Miranda Levy’s picture

The dev version fixes this.
If you continue getting the error after clearing your cache, then it is another module generating the error.

These two other modules have the same problem:
http://drupal.org/project/uuid
http://drupal.org/project/sharethis

benjaminkyta’s picture

Assigned: Unassigned » benjaminkyta
Status: Active » Reviewed & tested by the community

The dev version worked for me too. Thanks
[benjamin@mountbatten.net]

hanskuiters’s picture

I can confirm the dev version worked for me too.

ultimateboy’s picture

Status: Reviewed & tested by the community » Fixed

Confirmed this is fixed in the latest dev.... might I suggest tagging a new 7.x release?!

Anyways, closing this as its fixed.

Status: Fixed » Closed (fixed)

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

ultimateboy’s picture

Assigned: benjaminkyta » Unassigned
Priority: Normal » Critical
Status: Closed (fixed) » Reviewed & tested by the community

I have to do this.. I'm reopening and setting to critical until a new stable release is out.. this bug has gotten me multiple different times on multiple sites.

bobbingwide’s picture

Title: all-time pass-by-reference has been deprecated in drupal_load() » call-time pass-by-reference has been deprecated in drupal_load()

I saw this problem for the first time today when I tried running a custom module developed on Drupal 6 in a Drupal 7 implementation.
I had made no changes to the code other than to update the .info files to say core = 7.x.

I discovered that you can get the message even if the code isn't executed; it only needs to be parsed.
The following code will produce the message.

Include file called ro.inc contains

<?php 
function actpbra( &$byref ) { }
function actpbrc( &$byref) {  actpbra( &$byref ); }

Main file contains

error_reporting( E_DEPRECATED );
require_once( "ro.inc" );

The conditions you need to satisfy to get the message are:

  • pass a parameter by reference - as in the call to actpbra() from actpbrc()
  • the 'error' in the code being included from a separate file
  • Error reporting set to include E_DEPRECATED prior to the inclusion of the file containing the bad code

The problem is fixed by removing the & on the call to the function that has declared its parameter as being passed by reference.

In this simple example I've not managed to reproduce the apparently incorrect reporting of the message as if it came from the main file... but I'm working on it.

bobbingwide’s picture

Based on the above, http://drupal.org/node/1166504#comment-5843292, the unwanted & is on line 605 of collapse_text.module
changing it from

    array_walk_recursive($variables['page'], '_collapse_text_preprocess_page_walk_callback', &$found);

to

 array_walk_recursive($variables['page'], '_collapse_text_preprocess_page_walk_callback', $found);

eliminates the message.
This appears to be simpler than the dev fix ... but I haven't checked if the code actually works.

bobbingwide’s picture

I've found out why I couldn't get the message to be reported from the wrong place #1166504-10: call-time pass-by-reference has been deprecated in drupal_load()
and have now raised an issue suggesting an improvement to Drupal error reporting code. #1525400: Improve problem determination for 'Call-time pass-by-reference has been deprecated' by changing _drupal_error_handler_real()

liquidcms’s picture

StatusFileSize
new481 bytes

here is the patch for the fix listed in #11

btw, this error is a result of using php 5.3; which is when this use was deprecated

dotman’s picture

either fix breaks it for me at dreamhost running php 5.3. Is there another way to suppress the error?

thanks.

mhd999’s picture

I got the same problem and it's gone by stopping the beta modules for my case it was "Publish button modules"
is there in other solution !!?

mfoda’s picture

I'm new to drupal and I've noticed multiple times the suggestion to use the dev version of a module in response to some issue. I was wondering how safe that is on a production site. Does it vary by module? Or is it only OK to use the dev version when a stable release for the same drupal version exists? Also if you use the dev version does your module get updated when a new update is made to the stable release?

thanks in advance

mhd999’s picture

Well i think no one use dev version when other stable one available . also updating issue if it occur might be solved in the stable version so never use dev when stable is available

mfoda’s picture

@ liquidcms

here is the patch for the fix listed in #11

Your patch isn't working. I think you took out the wrong '&'

Your patch removes the '&' from line 614: function _collapse_text_preprocess_page_walk_callback ($val, $key, &$found) {

Which is not the same line as the fix in #11.

Just manually do it at line 605

mfoda’s picture

OK i guess I misunderstood this. You need to take out both '&'s in order for the error to disappear.

So use both #11 and #13. Neither works on its own.

onewomanbiz’s picture

After the latest Drupal core update, this error appeared. It only disappeared after de-activating Collapse Text Module.
The previous messages are not clear.

We tried removing extra character "&" preceding $found on the two instances as indicated without success.

Can anyone confirm a fix for the error?

pukku’s picture

Status: Reviewed & tested by the community » Fixed

HI! I'm about to put up a simpler solution and create a release node for a new version. I'm just going to always include the .js file. The amount of trouble that trying to dynamically add the collapse.js file has caused is more than the feature is worth.

Status: Fixed » Closed (fixed)

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

lovelykaushik86’s picture

Thnku so much cpelham. ur solution worked for me