Warning about filters

VladSavitsky - June 5, 2008 - 21:41
Project:PM Lite
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:rszrama
Status:closed
Description

Hi, Thanks a lot for a great module!
I have been using a Privat Message and it not a best choice.
I installed PM_lite on D6.2 and got this message at the top of page (node/add/pm)

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupalcook/domains/drupalcookbook.ru/public_html/sites/all/modules/default_filter-5.x-2.0-patched/default_filter.module on line 201.

This is a patched version of default_filter-5.x-2.0 to work with a Drupal 6.2.
But this module works fine in all other cases. So PM_lite probably do somthing wrong. I'm attaching a patched version of Default_Filter.module

I'll try to help. I like this module.

AttachmentSize
default_filter-5.x-2.0-patched.tar_.gz3.98 KB

#1

VladSavitsky - June 5, 2008 - 21:59

Forgot to write:

Module default filter wasn't set to serve the "privat message" node type.
When I setup a rule for "pm" type nothing was changed - message still appears at the top of page.

#2

rszrama - June 7, 2008 - 13:51
Assigned to:Anonymous» rszrama
Status:active» fixed

Sorry, I don't believe this is an issue w/ PM Lite. That module is hardcoded to look for an array in the node form array with the key 'body_field', and because that doesn't exist the module is throwing up errors. You should modify the code to make sure the second argument of the array_key_exists() calls is even an array before looking for a key in it.

Honestly, the module shouldn't just assume everyone will name their body fields the same thing... unless there's some standard I missed when writing my implementation of hook_form(). For example, that default filter module will break w/ the same error message on a node type that doesn't have a body field (which anyone can turn off on a content type's edit form).

Marking this issue fixed.

#3

VladSavitsky - June 8, 2008 - 16:08

Ok. Thanks for your replay.
I post this issue here because default filter works fine with other content types so I decided that problem could be with this module.
I'll hack a default filter module to use the PM_lite. I like this module.
Thanks a lot.

#4

Anonymous (not verified) - June 22, 2008 - 16:12
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.