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

Removes the filter that removed gf max files validation #2104

Conversation

omarkasem
Copy link
Collaborator

@omarkasem omarkasem commented Aug 13, 2024

  • This solves Edit Entry doesn't respect File Upload's Maximum Number of Files setting #2086
  • The edit entry validation for max files works but after the user clicks edit entry.
  • The issue here is the files are uploaded to the uploads folder before they are validated
  • Gravity forms already has a good ajax validation for this part but we have a filter that removes that validation in GravityView
    add_filter( 'gform_plupload_settings', array( $this, 'modify_fileupload_settings' ), 10, 3 );
  • It says that it was added because our custom validation already handles that so we don't have a conflict ( I tried to find that conflict but couldn't)
  • So we can leave it as it is and we would have ajax validation (gf validation) and also a custom validation after the user clicks update (Our validation)
  • Or we can keep the filter that removes gf validation and build our own.

@mrcasual
Copy link
Collaborator

@rafaehlers, could you please test to ensure that removing our custom validation doesn't unexpectedly break anything?

@omarkasem
Copy link
Collaborator Author

@rafaehlers, could you please test to ensure that removing our custom validation doesn't unexpectedly break anything?

I think you mean removing the filter that removes the gf ajax validation (which is what's been done in this PR)

Copy link
Contributor

@rafaehlers rafaehlers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omarkasem said:

The issue here is the files are uploaded to the uploads folder before they are validated

I don't see this being a problem! In my tests, this didn't affect anything.

Removing this filter seems to be the solution we needed.

@mrcasual mrcasual merged commit c6e1234 into develop Aug 16, 2024
2 checks passed
@mrcasual mrcasual deleted the issue/2100-fix-optgroup-option-not-selected-in-search-widget-fields branch August 16, 2024 02:34
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

Successfully merging this pull request may close these issues.

Edit Entry doesn't respect File Upload's Maximum Number of Files setting
3 participants