Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-02-11 21:03:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
'value' and 'val'
Since their introduction I’ve been using variable and if_variable extensively. So lately when I needed if_custom_field it took a while before I remembered that the proper attribute for that tag is not value
but val
…
Can we please have value
for if_custom_field too?
Offline
Re: 'value' and 'val'
+1… I’m always forgetting val
Offline
Offline
Re: 'value' and 'val'
D’oh! this tripped me up the other day as well. +1
Offline
Re: 'value' and 'val'
mrdale wrote:
+1… I’m always forgetting val
Apologize to Val, then, not us ;)
+1 for consistent attribute names
Code is topiary
Offline
Re: 'value' and 'val'
+1…
Oh, wait, I’m the one that’s supposed to implement this stuff, not vote for it. Rats :-)
For backwards compatibility we have a few options:
- On upgrade, search for any if_custom_field tags that use val= and change them to value= (P.S. I wouldn’t want to write the regex for that!)
- Allow value as well as val and deprecate val (which only means warnings in dev/testing modes)
I favour option #2. Any other advances/ideas?
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: 'value' and 'val'
Bloke wrote:
Allow value as well as val and deprecate val (which only means warnings in dev/testing modes)
Yes, can’t go wrong that way, as long as you’re really willing to drop the deprecated form within another release or two.
Might help to publish some “best practices” guidelines for updating. Aside from the you’re-insane-if-you-don’t-do-this obvious steps (do full backups, upgrade on the development server first), include instructions for finding and correcting deprecated tags/attributes. Of course smd_where_used is indispensable for this.
Code is topiary
Offline
Re: 'value' and 'val'
jsoo wrote:
as long as you’re really willing to drop the deprecated form within another release or two.
I can’t see any issue with losing it — think it’s been requested before actually — but I’ll wait for the dust to settle and allow anyone to object before I press ahead.
Might help to publish some “best practices” guidelines for updating.
Good idea. Perhaps generically as part of the detailed installation instructions on Textbook? Or some more detail in history.txt / README.txt? Or both? (does anyone read those? :-)
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: 'value' and 'val'
Bloke wrote:
Perhaps generically as part of the detailed installation instructions on Textbook? Or some more detail in history.txt / README.txt? Or both? (does anyone read those? :-)
We could rename README.txt to IGNOREME.txt. Might get more people to look at it.
I’ll consider adding to the TextBook instructions.
Code is topiary
Offline
Offline
Re: 'value' and 'val'
I agree with Bloke about showing deprecated message for val
attr. But auto update – is really needed? There were no autoupdate for sitename -> site_name
, so, warning message in test/debug mode would be enough.
Yes, i wrote here because once again recieved an hour of debugging after uses value
attr :)
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: 'value' and 'val'
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