Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Checking for name of custom_field upon creating them
Once again had some hours of debugging – named on custom_2 as “sort”. After this article_custom was searching in custom_2 everything, i entered in sort="Title"
attr :)
<txp:article_custom limit="999" break="li" wraptag="ul" sort="Posted asc" section='<txp:section />'>
..was givven this:
[SQL (0,000347852706909): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('video') and custom_2 like 'Posted asc' order by Posted asc limit 0, 999]
Figured out the bug only after started new “bug thread” in this forum and typed “…custom_field was named “sort”…
So, the idea is to check cf names and throwing errors in the top. It would be very handy for newbies (and for older too :) i think.
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Checking for name of custom_field upon creating them
Yes, I went through the same thing some years ago. Makes sense to have Txp check for reserved names when an admin renames a custom field.
Last edited by jsoo (2011-01-26 13:50:49)
Code is topiary
Offline
Re: Checking for name of custom_field upon creating them
jsoo wrote:
Makes sense to have Txp check for reserved names
Or namespace custom fields…?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Checking for name of custom_field upon creating them
Even better.
Code is topiary
Offline