Why can’t I upload files to WpForms anymore?

Top WooCommerce & WordPress Plugins Forums File Renaming on Upload – WordPress Plugin Why can’t I upload files to WpForms anymore?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #100041
    blankHemligg
    Guest

    Following up on this:
    https://wordpress.org/support/topic/conflict-with-wpforms-1-7-2/

    I can report that a conflict with WpForms version 1.7.2 has appeared. It worked fine up til the the version 1.7.1.2
    The problem is that you cannot upload files within a WpForms form any more.
    And the developers of WpForms doesn’t seem to think it is their fault. :/

    I have tried to get them to tell us what action to exclude like we did in the following solution:
    https://wordpress.org/support/topic/profile-photo-uploads-stops-working/

    I received this:
    —- BEGIN REPLY FROM WPFORMS —
    Here are the front-end actions that you’ll want to check against:

    $wpforms_frontend_actions = [
    	'wpforms_submit',
    	'wpforms_file_upload_speed_test',
    	'wpforms_upload_chunk_init',
    	'wpforms_upload_chunk',
    	'wpforms_file_chunks_uploaded',
    	'wpforms_remove_file',
    	'wpforms_restricted_email',
    	'wpforms_form_locker_unique_answer',
    	'wpforms_form_abandonment',
    ];

    And the code that you’ll likely be needing would be something like:

    $wpforms_frontend_actions = [
    	'wpforms_submit',
    	'wpforms_file_upload_speed_test',
    	'wpforms_upload_chunk_init',
    	'wpforms_upload_chunk',
    	'wpforms_file_chunks_uploaded',
    	'wpforms_remove_file',
    	'wpforms_restricted_email',
    	'wpforms_form_locker_unique_answer',
    	'wpforms_form_abandonment',
    ];
    
    if (in_array($info['request']['action'], $wpforms_frontend_actions)) {
    	$validation = false;
    }

    Please note that as there isn’t an issue with the default functionality of our plugin, this is outside the scope of our support, along with customizations or integration of third parties such as this. The information we’ve provided here should help, but is provided for reference as a courtesy.

    I hope this helps! Our testing was successful, but how code works will always ultimately depend on the entirety of its codebase.
    —- END REPLY FROM WPFORMS —

    But I haven’t been able to get it working with that code. So I’m stuck.
    The code in bp-custom.php looks like this:

    add_filter( 'frou_renaming_validation', function( $validation, $info ){
    	$wpforms_frontend_actions = [
    	'wpforms_submit',
    	'wpforms_file_upload_speed_test',
    	'wpforms_upload_chunk_init',
    	'wpforms_upload_chunk',
    	'wpforms_file_chunks_uploaded',
    	'wpforms_remove_file',
    	'wpforms_restricted_email',
    	'wpforms_form_locker_unique_answer',
    	'wpforms_form_abandonment',
    	];
    	if (		
    		isset( $info['request']['action'] )
    		&& ! empty( $action = $info['request']['action'] )
    		&& ( 'bp_avatar_upload' === $action || 'bp_avatar_set' === $action || (in_array($info['request']['action'], $wpforms_frontend_actions)) )
    	) {
    		$validation = false;
    	}
    	return $validation;
    }, 10, 2 );

    If you want I can supply you with the WpForms versions and/or access to a test site to try it out.

    #100042
    blankPablo Pacheco
    Participant

    Hi Hemligg,

    Yes, please send the WPForms to [email protected]. I’ll take a look if I can add compatibility.

    Just a detail I couldn’t get, the upload from WPForms doesn’t work anymore or the renaming doesn’t work?

    #100043
    blankHemligg
    Guest

    File upload within a form doesn’t work any more.

    We get the error message “File upload error. Failed to write file to disk.”.

    But it works fine if we disable your plugin. Or use WpForms version  v.1.7.1.2 or  older.

    #100044
    blankPablo Pacheco
    Participant

    Hi,

    This is just to inform that since v1.3.4 of the Pro version, there will be a new compatibility option with WPForms.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.