Active
Project:
Tag Trap
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Apr 2009 at 15:46 UTC
Updated:
19 Apr 2009 at 17:03 UTC
One issue I have come upon is the use of special characters in free tagging terms. Specifically, I needed a module that restricted free tags to alphanumeric characters because I use those terms as arguments in Views. User cwgordon07 graciously wrote me a small module called "taxonomy alphanumeric" that does that. It hasn't been committed as a project, so if you want you could add this functionality. Otherwise it can be submitted as a separate module.
Comments
Comment #1
aj045 commentedSo have functionality where it'd remove the tag if it had one or more non-alphanumeric characters in it, is this correct?
Comment #2
nirad commentedCorrect. In my case, I actually altered it slightly to also allow the space character. More broadly, perhaps you could modify tag trap so that it not only rejects specific terms but also characters within terms that the user can choose. So some users may just want to restrict certain special characters, others may want to restrict all uppercase characters (or perhaps have them converted to lowercase). In most cases, I would think that allowing special characters in free-tagging terms is more trouble than its worth. It really complicates the process of using those terms as data.
Comment #3
aj045 commentedOkay. This sounds like an interesting idea. Do you have any ideas on how to implement it on the front end? One idea I had was to have a text field where you can enter a regular expression string, save that with the vocabulary and then check the entered terms against the regular expression pattern. You get a match, then form validation fails, otherwise continue.
Comment #4
nirad commentedI think that sounds perfect. Obviously it would need a front-end rather than requiring people to alter the module with their regular expression.
By the way, you may want to look at http://drupal.org/project/validation_api and http://drupal.org/project/validations
Comment #5
aj045 commentedI added this functionality as well as some other major and minor changes. This is all in the dev release (download here http://drupal.org/node/394756/release). You'll want to reinstall the module completely because the table schema has change significantly. Tell me of any and all bugs you come across.