Page 1 of 3

Problems with Image uploads

Posted: Wed Aug 19, 2009 8:03 am
by Stuardo
Hi all

I am new to this game, so pls stay with me!

I am trying to upload ADDITIONAL images to my products..

When up loading additional images for the products, it does not keep existing images, it discards the old ones. You have to add the links to every image each time you want to add an image. is this correct or am I missing a trick?

Stu

Re: Problems with Image uploads

Posted: Wed Aug 19, 2009 9:10 am
by Daniel
shit!

just noticed this. its a bug.

Re: Problems with Image uploads

Posted: Wed Aug 19, 2009 4:25 pm
by Stuardo
Hi Daniel

Glad to be of service.

Any eta on a fix please?

Cheers
Stu

Re: Problems with Image uploads

Posted: Thu Aug 20, 2009 6:50 am
by Stuardo
Do I need to raise this as a bug?

Many Thanks
Stu

Re: Problems with Image uploads

Posted: Thu Aug 20, 2009 10:40 am
by smallpox
i have this problem too...... i'm crossing my fingers.

Re: Problems with Image uploads

Posted: Thu Aug 20, 2009 5:41 pm
by Daniel
i'm trying to get the next release out tonight.

I have added googlebase and need to finish google checkout and checkout without an account.

Re: Problems with Image uploads

Posted: Thu Aug 20, 2009 11:38 pm
by Daniel
re-download the latest version. I just put a fix in.

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 12:07 am
by smallpox
thanks, found the difference:

if (isset($this->request->post['product_image'])) {
$data['product_image'] = array_merge($data['product_image'], $this->request->post['product_image']);
}

...

daniel, is there a way to use something like:

http://fisheye.freeswitch.org/browse/Fr ... 4&r2=14575

where we could tell all the changes?

thanks

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 12:56 am
by Daniel
i just did another upload because there was a bug with that. please try again.

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 12:58 am
by smallpox
thanks, i just noticed it. that's why i came on to write that it didn't work ;)

it actually still doesn't work for me:

if (isset($data['product_image']) && isset($this->request->post['product_image'])) {
$data['product_image'] = array_merge($data['product_image'], $this->request->post['product_image']);
}

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 2:03 am
by Daniel
what is happening when you use the latest code?

it works fine for me.

any errors?

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 2:05 am
by smallpox
no errors, it just deletes the original images from sql.

if there is 03.jpg and 04.jpg, it will just replace it with 05.jpg in sql (if i upload 05.jpg)

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 2:18 am
by smallpox
411729 Query INSERT INTO product_image SET product_id = '74', image = '1.jpg'

that's when i upload 1.jpg into a product

i go again to the product - > image and add image, select 2.jpg

i get this in the log

411736 Query INSERT INTO product_image SET product_id = '74', image = '2.jpg'

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 2:34 am
by smallpox
i've tested it on a new install, your latest one

MD5 (opencart_v1.3.2.zip) = 7967ff82a1e423a7483e7d8d1ba68e5f

and it's doing the same thing still

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 3:07 am
by Unknown
Will there be a patch for this bug because I can't keep uploading the whole release each time because I make many changes ???

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 4:36 am
by Daniel
smallpox wrote:411729 Query INSERT INTO product_image SET product_id = '74', image = '1.jpg'

that's when i upload 1.jpg into a product

i go again to the product - > image and add image, select 2.jpg

i get this in the log

411736 Query INSERT INTO product_image SET product_id = '74', image = '2.jpg'
theses are not errors

they are just sql queries.

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 4:41 am
by smallpox
daniel, i understand.. but when comparing to 1.2.8, 1.2.8 adds the filenames through sql queries, your latest patched 1.3.2 still does not work. i've patched and tried it on a new installation...

i'm just showing you that if you look at http://forum.opencart.com/viewtopic.php?f=20&t=5793 you can see what 1.2.8 does and you can see what 1.3.2 does through sql queries (i'm sure you already know)

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 6:03 am
by Daniel
the problem is you have 2 types of image data.

one is the files and the other is the post data.

files have to used to upload new images and post data stores the files names of the images already being used.

so the fix should be to merge both sets of data.

i'll keep looking into this.

I think I have an idea how to fix it.

Re: Problems with Image uploads

Posted: Fri Aug 21, 2009 6:11 am
by smallpox
thanks a lot Daniel, appreciate it.

Re: Problems with Image uploads

Posted: Tue Aug 25, 2009 3:19 am
by smallpox
any luck daniel?