-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid creating invalid custom_field names #456
Comments
I'm hoping the new custom field implementation will largely sidestep this. The rough plan is:
The fact that the names are wholly represented without spaces or special characters means that
That unfortunately still doesn't completely bypass the issue of what happens if you give a custom field exactly the same name as an attribute. For example, naming a field
I'm unsure if catching every possible attribute or database field name and rejecting it at creation time is particularly practical, long-term (I would be willing to be proved wrong if this is doable). There may be a way to be clever about it and determine that '50' isn't a column name so assume a CF was intended, but that's a little risky (and probably slower). A way round it is to simply forbid direct CF names as attributes in That leads to one other thing I'd like to do: make it possible to use In all cases, the Title is used for display purposes only, subject to the currently in-force language. Any further thoughts on this, please chime in here. There may be a better way to handle this. |
I would
I'm currently testing the first two points and it looks doable. |
Not sure we can do more in pre-CF branch. As long as it is not intended to be used as article filter, |
I'll give this a whirl. Looks good from a cursory glance at the code. Nice work! I'll sort the strings out. |
Firefox doesn't give the most useful default experience if you try and make a custom field with a reserved word. "Please match the requested format" is a bit obtuse, haha. But there's not much we can do about it when using the Better than letting it through and then it causing issues later. |
How do we feel about the string Can anyone come up with anything better? Bearing in mind this string can appear in the announcement box when saving Prefs, and the pre-flight check on Diagnostics, so it needs to supply context. Is |
A bit of JS could probably fix it. |
See:
http://forum.textpattern.com/viewtopic.php?id=43726
http://www.textpattern.net/wiki/index.php?title=Advanced_Preferences#Custom_Fields
Instead of having a list of "do not use" names for the custom_fields in the Wiki, it would be more userfriendly if TXP rejected those names when a user tries to create a custom_field with such a name. Not doing so results in problems that the average user cannot diagnose himself.
The way custom_field names are handled right now when parsing attribute values is really just an ugly hack. An alternative, which would break some of the current installs, is to no longer support the use of user-supplied custom_field names as attribute names.
The text was updated successfully, but these errors were encountered: