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

Required fields still not working #7036

Open
JoryHogeveen opened this issue Mar 23, 2023 · 10 comments
Open

Required fields still not working #7036

JoryHogeveen opened this issue Mar 23, 2023 · 10 comments
Assignees
Labels
Component: Block Editor Issues related to the Block Editor Component: React Issues related to React JS Priority: Blocker Issue is causing a problem that is holding a release or is a major bug that needs to be fixed ASAP Type: Bug
Milestone

Comments

@JoryHogeveen
Copy link
Member

JoryHogeveen commented Mar 23, 2023

Description

I know for sure this has been reported on several occasions and we've addressed this more than once.

For some reason the required option still isn't working properly and this gets reported again:

Due to the nature of this bug I really think we need to check this thoroughly and implement a proper fix.

Version

2.8+

@JoryHogeveen JoryHogeveen added Type: Bug Priority: Blocker Issue is causing a problem that is holding a release or is a major bug that needs to be fixed ASAP Component: React Issues related to React JS labels Mar 23, 2023
@JoryHogeveen JoryHogeveen added this to the Pods 2.9.14 milestone Mar 23, 2023
@jamieburchell
Copy link

jamieburchell commented Apr 5, 2023

I see you've linked my support topic which has a screencast showing the issue. Let me know if I can provide any more info.

@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.9.16, Pods 2.9.17 Jun 10, 2023
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.9.17, Pods 3.1 Jun 27, 2023
@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.1, Pods 3.2 Sep 4, 2023
@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.2, Pods 3.3 Dec 11, 2023
@JoryHogeveen JoryHogeveen modified the milestones: Pods 3.3, Pods 3.2 Feb 22, 2024
@rosa2
Copy link

rosa2 commented Aug 1, 2024

Just in case that can help, I posted in the plugin WordPress forum my temporary solution to have validation for required pods fields. I wish is useful to you. Thanks for the plugin :)

@sc0ttkclark
Copy link
Member

Working on pushing this forward in #7343

@Paktas
Copy link

Paktas commented Oct 14, 2024

Any progress on this?
18 months have passed for one of the most basic functionalities not working as expected.

@sc0ttkclark
Copy link
Member

@Paktas This is in the hands of a developer I've brought in to help us work past some issues I've seen with stability of the required logic on the Block Editor screen. The solution I had previously wouldn't stop submission in all cases.

@Paktas
Copy link

Paktas commented Oct 15, 2024

Validation seems such a basic functionality.
Works perfectly for required fields on ACF:
https://github.com/AdvancedCustomFields/acf/blob/c6b165369a85bd25136bc75095acd46fe8a45b05/includes/validation.php#L9

@sc0ttkclark
Copy link
Member

We've been trying to resolve a longstanding issue with Gutenberg here and ACF is doing the workaround through a JS override that can break other integrations.

The good news is that it appears a new version of Gutenberg has support for what we need but it's still marked as experimental. We are working on testing a solution that uses an ACF-like JS override on the submit process but our goal with this will always be to remain compatible with as many plugins as possible (and compatible with ACF) while ensuring every pathway towards saving results in validation checks.

@Paktas
Copy link

Paktas commented Oct 15, 2024

Can you link to Gutenberg experimental feature?
I understand compatibility is important, but not having data in pods due to validation flaws is a major show stopper.

@JoryHogeveen
Copy link
Member Author

JoryHogeveen commented Oct 15, 2024

@Paktas
Please check the PR I've made #7369

ACF currently has a similar solution (savePost override for the editor).
I've also added the filter solution as comments in the PR so once these become available we can change the current solution for a filter approach which is much-much-(much) better.

This issue wasn't with validation itself, that was working just fine. It's just not (yet) possible to properly prevent the block editor from saving since it ignores your own validation process. The currently available savePost JS hook is ran after the general post data is already saved.

Link to the issue on Gutenberg repo WordPress/gutenberg#58022
As you can see the __unstablePreSavePost is merged into GB 19 and is marked as a non-stable hook at this time. GB 19 will be released somewhere during the next major WP release cycle: https://developer.wordpress.org/block-editor/contributors/versions-in-wordpress/
We have no idea when such a hook will become a "stable" hook according to the GB devs.

@JoryHogeveen
Copy link
Member Author

@Paktas If possible, could you please take the time and let us know your test results on my PR? User feedback is very helpful to validate additions like these work as expected.

Direct link to the branch: https://github.com/pods-framework/pods/tree/feature/7343-form-validation
Direct link to the download ZIP: https://github.com/pods-framework/pods/archive/refs/heads/feature/7343-form-validation.zip

@JoryHogeveen JoryHogeveen self-assigned this Nov 12, 2024
@JoryHogeveen JoryHogeveen added the Component: Block Editor Issues related to the Block Editor label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Block Editor Issues related to the Block Editor Component: React Issues related to React JS Priority: Blocker Issue is causing a problem that is holding a release or is a major bug that needs to be fixed ASAP Type: Bug
Projects
Status: 👀 In review
Development

No branches or pull requests

5 participants