-
AuthorPosts
-
September 3, 2013 at 9:42 am #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.
September 3, 2013 at 6:26 pm #139018Hi 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
September 3, 2013 at 8:53 pm #139019Hi 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
September 4, 2013 at 3:52 am #139020September 4, 2013 at 5:39 am #139021September 6, 2013 at 9:46 am #139022Hey!
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
-
AuthorPosts
- The topic ‘Error with contact form’ is closed to new replies.