I have an error on node-page:

Warning: Illegal string offset 'field' in function commentaccess_query_comment_filter_alter() (line 248 in file /site.com/sites/all/modules/commentaccess/commentaccess.module).

This patch works fine: http://drupal.org/node/1414412#comment-5703050

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Fidelix’s picture

Applying that patch did not fix the problem for me.

Fidelix’s picture

Priority: Normal » Major

The module is unusable on PHP 5.4.
I see that some modules with the same problem fixed it in their end, so I'm bumping this to major.

Sean-Khan’s picture

I confirm, I get the error & that the patch has no effect for me either.

Alan D.’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
658 bytes

;)

Alan D.’s picture

Issue summary: View changes

Sorry, line 248 not 250

pradeep22saini’s picture

foreach ($conditions as $key => &$condition) {
+ if(is_array($condition)){
if ($condition['field'] == 'c.status' && $condition['value'] == COMMENT_PUBLISHED) {
unset($conditions[$key]);
}
+ }
}
I have added + if(is_array($condition)){ this condition of Is_array() and it removed the error. I don't know how to make patch. But adding this solved my problem.

loze’s picture

Patch in #4 works for me. Thanks!

JBecker’s picture

Patch #4 works.

formatC'vt’s picture

Issue summary: View changes
FileSize
752 bytes

Works, but hardcoding for '#conjunction' this is bad solution.
We should check existing keys. Patch attached.

formatC'vt’s picture

Status: Needs review » Fixed

thanks, committed

  • formatC'vt committed 8f42c9b on 7.x-1.x
    Issue #1875454 by Alan D., formatC'vt: PHP 5.4 Warning: Illegal string...

Status: Fixed » Closed (fixed)

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

cheans’s picture

Patch #4 works fine for me. Thanks~~

mausolos’s picture

#8 patch worked for me against php7