Upgraded to php 5.3.1 and got multiple error messages about "expected to be a reference, value given" in calendar, date,.... module. found a patch for all of them, except facted_search. The waring is the usual call by reference warning

warning: Parameter 1 to faceted_search_ui_faceted_search_init() expected to be a reference, value given in ..........   \includes\module.inc on line 487.

same problem with faceted_search_query_alter in facted_search_ui. I followed #360605: PHP 5.3 Compatibility a bit and tracked it back to the module_invoke_all calls in faceted_search.inc for faceted_search_init (one time) and faceted_search_ui_faceted_search_query_alter (two times).

I have no idea how to fix that in general and the discussions in #360605: PHP 5.3 Compatibility and other posts were a bit confusing. What I got is that there are problems with moudle_invoke_all calling functions with references??? For now I fixed my problems with replacing module_invoke_all with the actual function call e.g.:

module_invoke_all('faceted_search_init', $this);

replaced by

faceted_search_ui_faceted_search_init($this);

Any idea how to solve that in general? No one else having theses problems??? Thought I at least report it and post my tmp solution as even this took me couple of hours to figure out.

CommentFileSizeAuthor
#2 faceted_search_php53fixes.patch1.82 KBberdir

Comments

ti2m’s picture

Could it be that we can just remove the & without worries in case of complex data types being handed in????

then it would suffice to just change faceted_search_ui_faceted_search_query_alter and faceted_search_ui_faceted_search_init in facted_search_ui.module to

function faceted_search_ui_faceted_search_init($env){

and

function faceted_search_ui_faceted_search_query_alter($search, $query) {
berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.82 KB

No, removing the & would break PHP 4 compatibility. The correct fix is to call the functions directly, as done in the attached patch. Please test and set to RTBC if it works.

David Lesieur’s picture

Status: Needs review » Fixed

Patch committed. Thanks!

Status: Fixed » Closed (fixed)

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

ploc’s picture

Status: Closed (fixed) » Needs work

Hello David,

Do you plan to release a new version of the module, including the patch from Berdir ?

ploc’s picture

Status: Needs work » Patch (to be ported)

After applying the path, I can say that it works well on drupal 6.22 and last version of faceted search.

Patch is ready to be included in a new release of faceted search.

damienmckenna’s picture

Status: Patch (to be ported) » Fixed

Agreed on the need for another release, even another beta would help everyone. Thanks.

Status: Fixed » Closed (fixed)

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