news icon indicating copy to clipboard operation
news copied to clipboard

overrideFlexformSettingsIfEmpty treats '0' as empty which is incorrect for some fields

Open github1maxserv opened this issue 4 years ago • 2 comments

Bug Report

Current Behavior The flexform has for the option settings.recursive the values [empty], '0', '1', and so on. If this field is included in overrideFlexformSettingsIfEmpty the value '0' will be treated as empty and the TypoScript value will be used. With a TS default of for example "5" it's impossible to set it to '0' in the flexform

Expected behavior/output For fields where [empty] and '0' have different meaning overrideFlexformSettingsIfEmpty should not treat '0' as empty.

Environment

  • TYPO3 version(s): [10.4.latest]
  • news version: [master]
  • Is your TYPO3 installation set up with Composer (Composer Mode): [yes]
  • OS: [Linux]

Possible Solution Seems quite complex to have a generic solution. As a workaround we've patched EXT:news to actively check for the 'recursive' field.

Additional context [none]

github1maxserv avatar Aug 30 '21 08:08 github1maxserv

but you didn't provide / upload your patch, did you?

DavidBruchmann avatar Sep 18 '21 15:09 DavidBruchmann

Hi David, as I wrote under "Possible solution" we didn't find a generic solution. Because the issue was discovered close to going live and there was just a single field ('recursive') that was problematic a patch was made to treat "0" as not empty just for this field. It's not a real solution. Perhaps it needs an extra setting to list the fields for which the "zero is interpreted as empty" check can be skipped?

github1maxserv avatar Sep 19 '21 13:09 github1maxserv