[TYPO3-v4] New slider wizard embarrassment
François Suter
fsu-lists at cobweb.ch
Thu Nov 10 16:02:15 CET 2011
Hi all,
As I'm working on updating the TCA reference for TYPO3 4.6, I stumbled
upon an embarrassing situation with the new slider wizard, which we need
to solve as early as possible as it probably implies a breaking change.
Please read on and share your thoughts.
The slider wizard is dramatically under-documented so I started digging
into the code for the details. In particular class
t3lib_TCEforms_ValueSlider which creates the slider.
From the code (lines 51-52) it appears possible to define a minimum and
a maximum for the slider, which makes sense of course. However it relies
on TCA field properties "min" and "max" for this, which is the real issue:
1) "min" does not exist (this is easy, we could just document it)
2) "max" exists (for input-type fields) but is used for the "maxlength"
attribute and not for the maximum value. We have the "range" property
for this instead.
I am quite surprised that this actually got through the review process.
The situation must be corrected and I propose the following:
- the slider wizard can be used for input-type and select-type fields.
- for select-type fields, it's not an issue, because it doesn't need a
min, nor a max. It just "slides" through the items array
- for input-type fields, it *must* use the range property, because "max"
serves another purpose.
This represents a breaking change, but it's okay IMO, because I think
only few (if any) extensions already make use of this wizard (it's new
and not yet officially documented). It's not used in the Core and it
should be fixed before its usage spreads.
What do you think?
Cheers
--
Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
More information about the TYPO3-project-v4
mailing list