Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#8 | fix_illegal_string_offset-1875454-8.patch | 752 bytes | formatC'vt |
#4 | commentaccess-1875454-4-conjunction-check-on-hook_query_TAG_alter.patch | 658 bytes | Alan D. |
Comments
Comment #1
Fidelix CreditAttribution: Fidelix commentedApplying that patch did not fix the problem for me.
Comment #2
Fidelix CreditAttribution: Fidelix commentedThe 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.
Comment #3
Sean-Khan CreditAttribution: Sean-Khan commentedI confirm, I get the error & that the patch has no effect for me either.
Comment #4
Alan D. CreditAttribution: Alan D. commented;)
Comment #4.0
Alan D. CreditAttribution: Alan D. commentedSorry, line 248 not 250
Comment #5
pradeep22saini CreditAttribution: pradeep22saini commentedforeach ($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.
Comment #6
loze CreditAttribution: loze commentedPatch in #4 works for me. Thanks!
Comment #7
JBecker CreditAttribution: JBecker commentedPatch #4 works.
Comment #8
formatC'vt CreditAttribution: formatC'vt commentedWorks, but hardcoding for '#conjunction' this is bad solution.
We should check existing keys. Patch attached.
Comment #9
formatC'vt CreditAttribution: formatC'vt commentedthanks, committed
Comment #12
cheans CreditAttribution: cheans as a volunteer and commentedPatch #4 works fine for me. Thanks~~
Comment #13
mausolos CreditAttribution: mausolos commented#8 patch worked for me against php7