Use a better default value for the name of the filter
kiamlaluno - July 6, 2009 - 04:14
| Project: | Custom filter |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | 6.x-1.0-beta3, 6.x-2.0-beta1 |
Jump to:
Description
The actual default value used is something like "Filter #1" (where the number changes all times, but it is not random).
It would be better to use "Custom filter #1".
I also think that the name of the filter as shown in the list of filters Drupal found should always contain "Custom filter"; in that way, the administrator users would not wonder which module implement that filter (it's easy to wonder that because the name of the filter as shown in the Drupal user interface doesn't appear in the code). It would also resolve a problem with the string passed to t(), which is not a constant string (I can already hear potx.module screaming for that).

#1
This has been implemented.
When the user creates a new filter, the proposed name is something like "Filter #1" (the string is now translatable); if the user doesn't change it, the filter name that appears in the list of Drupal filters (in example, in the page that allows to select which filters to enable for an input format) will be "Custom filter #1 (Filter #1)" (also a translatable string).
I decided to use "Custom filter #1" to have a unique string, which would allow to understand what module implements the filter; I could have removed "Custom filter #1" if the default name was not changed, but I think it's better to keep the string as it is now (less code to develop, and a reason more for the user to change the default name that is given only to avoid problems with an already existing filter).
#2
#3
Automatically closed -- issue fixed for 2 weeks with no activity.