• I am getting this error when I upload a photo in the WP e-commerce plugin. I am pretty sure it is related to the thumbnail options which are a little unclear.:
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/(mysite)/wp-content/plugins/wp-e-commerce/wpsc-admin/includes/display-items-functions.php on line 984

    Here’s the corresponding template code:

    // regenerate size metadata in case it's missing
    		if ( ! image_get_intermediate_size( $post->ID, $check ) ) {
    			if ( ! $metadata = wp_get_attachment_metadata( $post->ID ) )
    				$metadata = array();
    			$file = get_attached_file( $post->ID );
    			$generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
    			$metadata['sizes'] = array_merge( $generated['sizes'], $metadata['sizes'] );
    			wp_update_attachment_metadata( $post->ID, $metadata );
    		}

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am having this same problem, same block of code:

    // regenerate size metadata in case it’s missing
    if ( ! image_get_intermediate_size( $post->ID, $check ) ) {
    if ( ! $metadata = wp_get_attachment_metadata( $post->ID ) )
    $metadata = array();
    $file = get_attached_file( $post->ID );
    $generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
    $metadata[‘sizes’] = array_merge( $generated[‘sizes’], $metadata[‘sizes’] );
    wp_update_attachment_metadata( $post->ID, $metadata );

    Totally clueless. Any help out there?

    I found some help here:
    http://designparc.com/2011/09/07/fix-wp-e-commerce-product-image-upload-problem/

    Note: when I downloaded the file: display-items-funtion.php it actually was line 984 and not line 1018. Still, this seemed to work for me!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warning: array_merge() error in WP e-commerce’ is closed to new replies.