Closed retoolstack closed 7 months ago
hey @retoolstack it looks like you might be bumping into this issue: https://github.com/StoutLogic/acf-builder/issues/83 ? If not, it'd probably be worth opening a new issue on https://github.com/StoutLogic/acf-builder/
hey @retoolstack it looks like you might be bumping into this issue: StoutLogic/acf-builder#83 ? If not, it'd probably be worth opening a new issue on https://github.com/StoutLogic/acf-builder/
Thanks @mike-sheppard
yeah that looks like that will solve it i will test now appreciate it I did search the tickets on composer but didn't think to check builder
Update Solved Please refer to
StoutLogic/acf-builder#83
Summary of the Problem:
The
addSelect
method in ACF Composer/Builder is exhibiting unexpected behavior when handling choices that are either numeric or consist of a single non-whitespace character. Normally, this method should return an array with distinct 'value' and 'label' keys for each choice. However, when the choice key is a single character or a number, the method incorrectly returns the 'label' text as the 'value', rather than the actual key.Observed Behavior:
With numeric (
1
,2
,35
) or single non-whitespace character keys (like'1'
,'2'
, or'a'
), both 'value' and 'label' in the resulting array are set to the 'label' text.Expected Behavior:
The 'value' should correctly reflect the key, and 'label' should be the corresponding text.
Workaround Observed:
Adding whitespace or using keys with more than one character (like
' 1'
or'_4'
) results in the correct behavior.This issue impacts the functionality of the
addSelect
method, especially in cases where numeric or single-character keys are essential. I tested ACF plugin directly as well and when using acf (not composer) the fields do not have this issue. indicating that this bug is specific to ACF Composer/BuilderThe ticket aims to resolve this inconsistency, ensuring that the method returns correct 'value' and 'label' pairs for all types of keys.