Skip to content

Validate "required" based on other fields in table filters - #2322

Draft
mvorisek wants to merge 1 commit into
developfrom
table_filter_dynamic_required_validation
Draft

mvorisek wants to merge 1 commit into
developfrom
table_filter_dynamic_required_validation

Conversation

@mvorisek

Copy link
Copy Markdown
Member

extracted from #2317

@DarkSide666

DarkSide666 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Isn't this good to merge too?

@mvorisek

mvorisek commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

The "dynamic required" must be based on getFormDisplayRules() rules to be elegant and what atk4 is all about. No need to reinvent wheel, just parse the Fomantic-UI rules, code the checks 1:1 and evaluate them in PHP.

@mvorisek
mvorisek force-pushed the table_filter_dynamic_required_validation branch from 4735369 to 98c3874 Compare November 3, 2026 09:24
@DarkSide666

Copy link
Copy Markdown
Member

You say no need to reinvent the wheel, but coding all Fomantic-UI rules into Atk php side will be duplication of code too.

Basically what has to be there is - if field is visible in form, then it should be filed. That's all. But sadly only client side (browser) knows field visibility as it's dynamic. So I can't validate that on backend php based on that.
Or am I missing something?

@mvorisek

mvorisek commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

You say no need to reinvent the wheel, but coding all Fomantic-UI rules into Atk php side will be duplication of code too.

That is hovewer the easiest part and maybe not even rules are needed to be supported. We can throw instead :)

Basically what has to be there is - if field is visible in form, then it should be filed. That's all. But sadly only client side (browser) knows field visibility as it's dynamic. So I can't validate that on backend php based on that. Or am I missing something?

Why? The rules are based on other fields and we have them posted back to the server.

See the coverage (-0.11 %), the current PR code is simply not good to be integrated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants