I'm getting this error on a search result page on the latest Drupal running on PHP 5.3:

warning: Parameter 1 to comment_nodeapi() expected to be a reference, value given in /Users/kris/Work/Projects/RK_SimplyAsk/dev/includes/module.inc on line 462.

I ran the following command and got the results below it:

$ grep -r "module_invoke('comment', 'nodeapi'" ./
./sites/all/modules/faceted_search/faceted_search_ui.inc: $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index');

So I went to faceted_search_ui.inc and changed this line:

$node->body .= module_invoke('comment', 'nodeapi', $node, 'update index');

to this:

$node->body .= module_invoke('', '', $node, 'update index');

And it worked, though I'm sure that doesn't actually fix the problem, and might lead to other problems related to the displaying of comments in the search results.

CommentFileSizeAuthor
#5 faceted_search_ui-9133558-1.patch.txt923 bytesj0rd

Comments

kriskhaira’s picture

Issue tags: +PHP 5.3

Tagged with "PHP 5.3".

botris’s picture

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

Confirming this still to be a problem with 6.x-1.0-beta2

botris’s picture

Moving to dev version solved all my php 5.3 and faceted search problems, including this one

zacho’s picture

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

Moving to dev did *not* solve this problem for me (6.x-1.x-dev of 2010-Jul-11).

j0rd’s picture

StatusFileSize
new923 bytes

This problem still exists in 6.x-1-x-dev as off Feb 11, 2011.

I've create a patch to resolve that issue against the version mentioned above. It's simple enough that you could apply it to any version.

To elaborate on how to encounter this bug. You must have a facetted search view enabled. Enable the keyword block in it. Search under the keyword block. I believe it uses comment counts or something to figure out how relavent a post should be and this is where the code is getting hit. To be honest, I didn't really look into the code, just patched the bug.

See attached patch. Please remove the comments from it and apply to dev.

stroobl’s picture

Status: Active » Reviewed & tested by the community

The patch seems to resolve the issue, thanks.

hansrossel’s picture

#5 Solves the problem here too, thanks!

kevstav13’s picture

#5 fixed my identical error as well. Thanks!

stenjo’s picture

In my installation the patch creates a new error when I try to run drush:

PHP Fatal error:  Only variables can be passed by reference in /var/www/sites/all/modules/faceted_search/faceted_search_ui.inc on line 55
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Only variables can be passed by reference in /var/www/sites/all/modules/faceted_search/faceted_search_ui.inc, line 55

Commenting out the added code for the comment_nodeapi() call, creates another error:

Missing argument 2 for taxonomy_nodeapi(), called in /var/www/sites/all/modules/faceted_search/faceted_search_ui.inc on line 61 and defined i /var/www/modules/taxonomy/taxonomy.module på linje 1198.

This patch definitely does not fix my issue with this error-message.
Commenting out the line calling comment_nodeapi() clears the error, but obviously then I loose something on the way...
Luckily I've not enabled comments on the node types being listed.

stenjo’s picture

Status: Reviewed & tested by the community » Needs work

Think the status of this must change.

stenjo’s picture

Status: Needs work » Reviewed & tested by the community

I really have to take that back. The patch in #5 actually fixed the problem for me too as soon as I learned to apply the patch correctly.
Sorted now.

echoz’s picture

After server upgrade to php5.3, using 6.x-1.x-dev (2/25), which had another php5.3 fix, resolved faceted search not showing up + another error - then still needed #5 patch for this error, which it fixed. Thanks.

WebmistressM’s picture

Category: bug » support
Status: Reviewed & tested by the community » Closed (fixed)

Hmm... Im still having problem applying the patch from 5. Using apply -v patchname in the module's directory turns up the following: "error: tmp/faceted_search_ui.inc: No such file or directory". Is there a step I may have forgotten?

kriskhaira’s picture

@WebmistressM, If you're having a problem applying the patch, why change the status to fixed?

WebmistressM’s picture

Hmm... I saw that it was already marked "closed" and I didnt want to necessarily reopen it as an issue because I am pretty sure its me just not applying the patch right.

ravi.khetri’s picture

Hmm... Problem Solved ...Thanks.

David Lesieur’s picture

Category: support » bug
Status: Closed (fixed) » Reviewed & tested by the community

Put back proper status. Patch #5 looks like the way to go.

David Lesieur’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)
Issue tags: -PHP 5.3

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