Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate InputfieldRepeater::isEmpty() differently when inputfield is in $singleMode (FieldsetPage) #533

Open
Toutouwai opened this issue Jul 25, 2024 · 0 comments

Comments

@Toutouwai
Copy link

Toutouwai commented Jul 25, 2024

Short description of the enhancement

FieldsetPage uses InputfieldRepeater for its inputfield, but it sets a special $singleMode that affects several things.

Something else that it would be good for $singleMode to do is change the behaviour of InputfieldRepeater::isEmpty().

A normal repeater can have zero items or many items, and so it makes sense that in normal mode isEmpty() will return a value based on the count of the repeater items.

But FieldsetPage always has one item, so InputfieldRepeater::isEmpty() doesn't do anything useful for FieldsetPage - it always returns false. When $singleMode is true it would be better if InputfieldRepeater::isEmpty() returned true when none of the fields within the FieldsetPage are populated and false when any of them are populated.

That would allow the "when blank/populated" visibility settings for the inputfield to work, as they currently don't work for FieldsetPage. Related forum topic: https://processwire.com/talk/topic/22666-visibility-fieldset-page/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant