Patch - Implementing additional filters

digi24 - March 20, 2009 - 22:45
Project:FeedAPI Item Filter
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hi,

I tried to implement an additional filter, but had some problems (both 6.x-2 as well as 6.x-1):

Not sure whether I came across a bug or I made a mistake at another point, but here are the two things that caused problems for me in feedapi_itemfilter.module and how I fixed them. The weight issue still is not optimal, more logic should be implemented to handle multiple filters with same weight.

approx. line 131:
- $modules[$options[$module]['#weight']] = $module .'_feedapi_itemfilter';
+ $modules[$options[$module]['weight']] = $module .'_feedapi_itemfilter';

approx 138:
rsort($modules);
// Run enabled filters.
foreach ($modules as $func) {

+ $module=str_replace("_feedapi_itemfilter", "", $func);

$func('process', $feed, $options[$module]);
}

 
 

Drupal is a registered trademark of Dries Buytaert.