Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
filter.module
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
20 Aug 2009 at 16:53 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dropcube commentedThe patch also introduces a new hook
hook_filter_info_alterto perform alterations on filter definitions. Think, for example:Comment #2
dropcube commentedTagging.
Comment #4
dropcube commentedIn this patch:
- Added API function to get all filters provided by modules, and cache them statically.
- Filters array are keyed by filter name (unique name), and not by
$module/$deltapair.- Remove multiple calls to
module_invoke($module, 'filter_info')in favor of the API function to get all filters.- Introduced
hook_filter_info_alterthat will allow modules to perform alterations on filter definitions.Comment #6
dropcube commentedupdated patch, fix the search.test issue.
Comment #7
sunNot sure how this has been added, but the line needs to be removed.
Exceeds 80 chars.
Wrong indentation.
Please keep the variable name "$filters".
Trailing white-space.
I don't agree with this change. There is no guarantee that two or more of our 4,000+ contributed modules try to register a filter having the same name.
To overcome this issue, filters should be registered keyed by module.
It would be good if we would use $format_name consistently - so instead of fixing the wrong variable name in form_set_error(), we should fix the variable declaration.
We still need the 'module' information (especially for some other issues in the queue).
uhm, what happened to this?
Beer-o-mania starts in 9 days! Don't drink and patch.
Comment #8
dropcube commentedThanks sun for the review.
Some points:
With #546350: Remove hardcoded numeric deltas from hook_filter_info() in, filter names must be namespaced with the module name: php_code, filter_autop, etc... IMO, There is not need to have filters keyed by modules.
I rather suggest #555870: Remove {filter} table, we don't need to store data about filters in the database.
hook_filter no longer exists, there is a fix for that in other issue.
Comment #9
dropcube commentedComment #10
moshe weitzman commentedI acknowledge that most of these registry hooks use cache_set() to persist for a long time. But thats becuase they do expensive stuff like build theme registry and menu tree. filter info should run fast enough that i do not mind running it on every page. caching brings along baggage about remembering to clear the cache when the data changes.
an alter hook sounds like a good idea.
Comment #11
sunRe-rolled for removed registry.
Fixed a couple of comments, coding-style issues, and some instances of $filter->name that should have been $filter->title.
Ready to fly.
Comment #13
sunSorry, wrong patch/issue.
Comment #15
mfer commented@sun is this RTBC from #11?
Comment #16
sunyes, #11 it is. I mistakenly attached a patch from another issue to this issue. It seems the testbot catched it up although I unpublished that comment immediately.
Comment #17
moshe weitzman commentedMy comments in #10 have not been addressed. I'm not going to be a hard ass about it, but I think this is one unnecessary cache.
Comment #18
sun@moshe: Could you clarify #10, please? The patch only introduces a static cache, and your comment sounds like you would agree that a static cache is sufficient and we shouldn't use a db-cache here (at least I would agree with that).
Comment #19
moshe weitzman commentedOh thanks for clarifying. I misunderstood badly. Reset status.
Comment #20
sunNot sure why it's still green, but it obviously needs a re-roll.
Comment #21
dries commentedLooks good. Committed to CVS HEAD.