Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28885

    Hi,

    on http://energiefrey.de/kontakt/angebotscheck/ i am using the visual form builder pro.

    On my test server everything went fine, but after the site has gone live on another server, either uploading via the form does not work or i do receive this error message. VFB asked me to post in the theme forum as well to see if one can offer a solution. So, your help is appreciated:

    Warning: Illegal string offset ‘size’ in /www/htdocs/w0104318/wp-content/plugins/visual-form-builder-pro/includes/email.php on line 298

    Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at /www/htdocs/w0104318/wp-content/plugins/visual-form-builder-pro/includes/email.php:298) in /www/htdocs/w0104318/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php on line27

    Warning: Cannot modify header information – headers already sent by (output started at /www/htdocs/w0104318/wp-content/plugins/visual-form-builder-pro/includes/email.php:298) in /www/htdocs/w0104318/wp-includes/pluggable.php on line 875

    Thanks for your help & have a nice day,

    Sebastian.

    #139018

    Hi Sebastian,

    I don’t have Visual form builder pro and i don’t think any of other team members do. Can you copy/paste 298th line in email.php file?

    Regards,

    Yigit

    #139019

    Hi Yigit,

    thanks for coming back.

    Here are lines 296 to 300:

    ‘ // Allow the uploads to be attached to a post/page

    $post_id = apply_filters( ‘vfb_upload_attach_post’, 0, $form_id );

    // Insert attachment into Media Library and get attachment ID

    $attach_id = wp_insert_attachment( $media_upload, $uploaded_file, $post_id ); ‘

    Since line 298 ist empty, i paste the whole “Handle Attachment” Section, maybe this is of some help to figure out the cause:

    ‘ // Handle attachments

    if ( $field->field_type == ‘file-upload’ ) :

    $value = ( isset( $_FILES[ ‘vfb-‘ . $field->field_id ] ) ) ? $_FILES[ ‘vfb-‘ . $field->field_id ] : ”;

    if ( $value > 0 ) :

    // 25MB is the max size allowed

    $size = apply_filters( ‘vfb_max_file_size’, 25 );

    $max_attach_size = $size * 1048576;

    // Display error if file size has been exceeded

    if ( $value > $max_attach_size )

    wp_die( sprintf( apply_filters( ‘vfb_str_max_file_size’, __( “File size exceeds %dMB. Please decrease the file size and try again.”, ‘visual-form-builder-pro’ ) ), $size ), ”, array( ‘back_link’ => true ) );

    // Options array for the wp_handle_upload function. ‘test_form’ => false

    $upload_overrides = array( ‘test_form’ => false );

    // We need to include the file that runs the wp_handle_upload function

    require_once( ABSPATH . ‘wp-admin/includes/file.php’ );

    // Handle the upload using WP’s wp_handle_upload function. Takes the posted file and an options array

    $uploaded_file = wp_handle_upload( $value, $upload_overrides );

    // If the wp_handle_upload call returned a local path for the image

    if ( isset( $uploaded_file ) ) :

    // Retrieve the file type from the file name. Returns an array with extension and mime type

    $wp_filetype = wp_check_filetype( basename( $uploaded_file ), null );

    // Return the current upload directory location

    $wp_upload_dir = wp_upload_dir();

    $media_upload = array(

    ‘guid’ => $wp_upload_dir . _wp_relative_upload_path( $uploaded_file ),

    ‘post_mime_type’ => $wp_filetype,

    ‘post_title’ => preg_replace( ‘/.[^.]+$/’, ”, basename( $uploaded_file ) ),

    ‘post_content’ => ”,

    ‘post_status’ => ‘inherit’

    );

    // Allow the uploads to be attached to a post/page

    $post_id = apply_filters( ‘vfb_upload_attach_post’, 0, $form_id );

    // Insert attachment into Media Library and get attachment ID

    $attach_id = wp_insert_attachment( $media_upload, $uploaded_file, $post_id );

    // Include the file that runs wp_generate_attachment_metadata()

    require_once( ABSPATH . ‘wp-admin/includes/image.php’ ); ‘

    Thanks for your advice.

    Cheers, Sebastian

    #139020

    Hi,

    Can you please post the whole code of email.php on http://pastebin.com/?

    Regards,

    Ismael

    #139021

    Hi Ismael,

    hope this is the right link: http://pastebin.com/ZXqfj9cr

    Regards, Sebastian,

    #139022

    Hey!

    See: https://kriesi.at/support/topic/error-message-at-wordpress-login – probably a whitespace character at the end of a php file triggers this warning.

    Best regards,

    Peter

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Error with contact form’ is closed to new replies.