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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions includes/extensions/edit-entry/class-edit-entry-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ function load() {
// Disable conditional logic if needed (since 1.9)
add_filter( 'gform_has_conditional_logic', array( $this, 'manage_conditional_logic' ), 10, 2 );

// Make sure GF doesn't validate max files (since 1.9)
add_filter( 'gform_plupload_settings', array( $this, 'modify_fileupload_settings' ), 10, 3 );

// Add fields expected by GFFormDisplay::validate()
add_filter( 'gform_pre_validation', array( $this, 'gform_pre_validation' ) );

Expand Down Expand Up @@ -635,26 +632,6 @@ public function save_field_value( $value = '', $entry = array(), $field = null,
return $value;
}

/**
* Remove max_files validation (done on gravityforms.js) to avoid conflicts with GravityView
* Late validation done on self::custom_validation
*
* @param $plupload_init array Plupload settings
* @param $form_id
* @param $instance
* @return mixed
*/
public function modify_fileupload_settings( $plupload_init, $form_id, $instance ) {
if ( ! $this->is_edit_entry() ) {
return $plupload_init;
}

$plupload_init['gf_vars']['max_files'] = 0;

return $plupload_init;
}


/**
* Set visibility to visible and convert field input key to string
*
Expand Down
Loading