Feature #102077
closedCustom default value for getFormValue() function in variant conditions
100%
Description
The "form" extension provides a getFormValue()
function to be used in variant conditions. It allows accessing form values without triggering an "undefined array index" error in PHP.
However, it unconditionally returns null
in case a form value is undefined. This should be extended to optionally provide a custom default/fallback value. This would shorten conditions considerably, e.g. when checking for values of a MultiCheckbox
field:
Before | After |
---|---|
getFormValue("multiCheckboxField") && "foo" in getFormValue("multiCheckboxField") | "foo" in getformValue("multiCheckboxField", []) |
Updated by Mathias Brodala about 1 year ago
- Subject changed from Default value for getFormValue() function in variant conditions to Custom default value for getFormValue() function in variant conditions
Updated by Gerrit Code Review about 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81307
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81307
Updated by Gerrit Code Review about 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81307
Updated by Gerrit Code Review 12 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81307
Updated by Gerrit Code Review 12 months ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81307
Updated by Mathias Brodala 12 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7b6ed162383fa36000a826fd2ac089b8c0dbaffb.