Flexform-TS override wrong for checkbox fields
|Priority:||Should have||Due date:|
|Category:||General Handling||Spent time:||-|
Von Anonymous - 17-7-2008
Inititally all fields in the flexform have an empty string as value. So if you do not touch it, you can change the value from TS. But once you set a checkbox its value becomes 1 and after unsetting it it becomes 0 - not ''! Now the value is not empty and you cannot turn on the feature (eg monthMakeMiniCal) via TS. So for a checkbox the comparsion in the controller should check for isZero and not for isEmpty.
Further thoughts: There might be a case were an editor needs to set an empty or a zero value in the FF. This will never work as in the FF there is no way to say that you want to use the default (defined by TS or somewhere else) or to set a value explicitely (even if the this value is empty or zero). Still I think it makes sense to change the behaviour for checkboxes the way described above. Alternatively all checkboxes could be turned into drop downs with values yes/no/default (1/0/-1). Default (
1) would mean use TS value.
Von Martin Kutschker vor mehr als 3 Jahre aktualisiert
As most (but not all) FF drop downs have select options that default to the TS settings, I suggest to implement the idea to turn the checkboxes into drop downs and handle the new -1 value within the controller.