Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2010-02-11 22:02:56

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: 'value' and 'val'

+1… I’m always forgetting val

Offline

#3 2010-02-11 22:05:40

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: 'value' and 'val'

+1 for val has sexy alias porn.

Offline

#4 2010-02-13 15:20:03

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: 'value' and 'val'

D’oh! this tripped me up the other day as well. +1

Offline

#5 2010-02-13 15:25:07

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#6 2010-02-13 15:44:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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:

  1. 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!)
  2. 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

#7 2010-02-13 16:02:49

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#8 2010-02-13 16:10:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

#9 2010-02-13 16:23:04

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#10 2010-02-13 16:26:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: 'value' and 'val'

Bloke wrote:

(does anyone read those? :-)

If you rename README.txt to DoNotReadThisIsSecretToDevsOnly.txt everyone is going to open it.

Edit. Jsoo said the same thing. lol.

Last edited by Gocom (2010-02-13 16:28:04)

Offline

#11 2010-03-05 06:37:48

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#12 2010-03-05 12:19:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

Board footer

Powered by FluxBB