WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problem with WP-ContactForm 1.5.1 and Add an Image (9 posts)

  1. denysri
    Member
    Posted 6 years ago #

    The Add an image (on the Write Post page) give me an error message,
    "..Are you sure you want to continue?.."
    when using WP-ContactForm 1.5.1

    I did deactivate all plugins and activate it one by one
    and found that WP-ContactForm 1.5.1 causing the problem.

    Is it just me?

    WordPress 2.5 and WP-ContactForm 1.5 (along with the others plugins active) did work fine for me.

  2. JonathanMurray
    Member
    Posted 6 years ago #

    It's not just you, version 1.5.1 of WP-ContactForm breaks the media manager in WordPress.

  3. ChattieKat
    Member
    Posted 6 years ago #

    I had the same problem. I deactivated all my plugins and then reactivated them one by one. WP-ContactForm is causing the problem with media manager. I think I'll try to find another Contact Form plugin so that I don't have to keep deactivating my contact form whenever I need to upload a photo.

  4. Sergey Biryukov
    WordPress Dev
    Posted 6 years ago #

    In the beginning of wp-contactform.php there are some lines entitled “Grab some default user info, if available”. In order for Media Uploader to function properly, they should be moved to wpcf_callback function, right before the call of wpcf_check_input. Worked for me, hope this helps.

  5. decavolt
    Member
    Posted 6 years ago #

    Thanks SergeyBiryukov for this fix. Works great for me.
    For others looking at this later:

    In wp-contactform.php, move this block of code (starting around line 13:

    //Grab some default user info, if available (Submitted by Dan)
    	$wpcf_auto_email = get_profile('user_email');
    	$wpcf_auto_ID = get_profile('ID');
    	$wpcf_auto_first_name = get_usermeta($wpcf_auto_ID, 'first_name');
    	$wpcf_auto_last_name = get_usermeta($wpcf_auto_ID, 'last_name');
    	$wpcf_auto_name = $wpcf_auto_first_name.' '.$wpcf_auto_last_name;
    	if (empty($_POST['wpcf_email'])) {
    		$_POST['wpcf_email'] = $wpcf_auto_email;
    	}
    	if (empty($_POST['wpcf_your_name'])) {
    		$_POST['wpcf_your_name'] = $wpcf_auto_name;
    	}

    And move it, placing it just before this line (around line 137):
    if(wpcf_check_input()) // If the input check returns true (ie. there has been a submission & input is ok)

  6. akagitano
    Member
    Posted 6 years ago #

    After modify wp-contactform.php the images upload restart working.
    Thanks
    SergeyBiryukov

  7. Matt
    Member
    Posted 6 years ago #

    Thanks! That fix worked perfect.

  8. redribera
    Member
    Posted 6 years ago #

    Gracias decavolt (Thank you decavolt).

    Esto soluciona el problema.

  9. hugin
    Member
    Posted 5 years ago #

    A bit late perhaps, but thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic