When a new filter (not yet in the database) is loaded on the filter configuration page, a default filter object is constructed to represent it; among other things, this is passed on to the 'settings callback' of that filter.

This object is not complete - among other things, it is missing the name of the filter itself. This information can be useful; for example, I am currently trying to port a D6 module to D7 which provides two filters that are similar enough that they share a settings callback (but have slight differences, so need to always know which filter they are being called for). There are ways around this, but the simplest is to fix this issue, which is a bug because the mock filter object should not be missing properties that would otherwise be passed in after it has made its way into the database.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Status: Active » Needs review
FileSize
837 bytes

Here's the patch - this should make the filter object have all the properties it's supposed to have.

sun’s picture

Status: Needs review » Needs work

The last submitted patch, complete-mock-filter-object-826380-1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, complete-mock-filter-object-826380-1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, complete-mock-filter-object-826380-1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
839 bytes

Re-rolled against HEAD.

David_Rothstein’s picture

#8: drupal.filter-filter-new.8.patch queued for re-testing.

David_Rothstein’s picture

If the tests still pass, I think I'm voting RTBC...

sun’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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