Forums

Warning: array_merge() error in WP e-commerce (3 posts)

  1. lt1833
    Member
    Posted 9 months ago #

    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!

  2. paunya
    Member
    Posted 9 months ago #

    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?

  3. jennsweb
    Member
    Posted 8 months ago #

    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!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.