Title: Warning: array_merge() error in WP e-commerce
Last modified: August 20, 2016

---

# Warning: array_merge() error in WP e-commerce

 *  [Sam](https://wordpress.org/support/users/lt1833/)
 * (@lt1833)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/warning-array_merge-error-in-wp-e-commerce/)
 * 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)

 *  [paunya](https://wordpress.org/support/users/paunya/)
 * (@paunya)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/warning-array_merge-error-in-wp-e-commerce/#post-2232842)
 * 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?
 *  [jennsweb](https://wordpress.org/support/users/jennsweb/)
 * (@jennsweb)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/warning-array_merge-error-in-wp-e-commerce/#post-2232900)
 * I found some help here:
    [http://designparc.com/2011/09/07/fix-wp-e-commerce-product-image-upload-problem/](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.

 * 2 replies
 * 3 participants
 * Last reply from: [jennsweb](https://wordpress.org/support/users/jennsweb/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/warning-array_merge-error-in-wp-e-commerce/#post-2232900)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
