PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Classifieds Support > Classifieds Bug Reports

Classifieds Bug Reports Post any problems you may be having with Classifieds here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old September 11th, 2008, 11:37 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Apr 2005
Posts: 34
Changing an Ad's category doesn't check for existing images

We recently discovered a bug with moving an ad to a different category. The ad that gets moved is fine, however if there is already an existing ad in that category that has an image with the same filename as an image from the moved ad, that file gets overwritten and now two ads share the same image(s).

I checked pp-inc.php and noticed the move_image function just copies the file over instead of doing a file_exists check like the handleupload function does in image-inc.php
silknet01 is offline   Reply With Quote
Old September 11th, 2008, 07:01 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Actually the file checking is done on image upload so there should never be files with the same name and its done in bulkupload
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 12th, 2008, 06:04 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Apr 2005
Posts: 34
The file checking is only done for the category the ad is first uploaded into. Once the ad is already in the classifieds system, if you change an ad's category, it moves the images over to the new category's directory -- where an image with the same filename might already exist.
silknet01 is offline   Reply With Quote
Old September 12th, 2008, 06:09 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Actually that would be incorrect as far as I see in the code. When an image is uploaded we check the entire products table to make sure an image in every single bigimage field does not exist and rename the image accordingly

This comes right from bulkupload.php which handles every single image uploaded

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 12th, 2008, 06:24 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Apr 2005
Posts: 34
I'm talking about moving an ad after it, along with its images, has already been uploaded.

Both the adm-misc.php and editproduct.php scripts call the move_image_cat function, which then calls the move_image function and no where along the way does it check to see if that filename already exists in the new category's directory.
silknet01 is offline   Reply With Quote
Old September 12th, 2008, 06:25 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
what I am saying here though is if an ad image can never have the same name as any image already present then how would moving it create an issue?

I know what your saying but I dont see anyway an ad can have the same name so this should not be an issue unless your running a way old version of classifieds I am not looking at code from here
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 12th, 2008, 06:33 PM   #7 (permalink)
Member
Verified Customer
 
Join Date: Apr 2005
Posts: 34
Ahh... okay, I now understand what you're talking about.

However, the handleupload function in the image-inc.php script doesn't handle the image files the same way -- it only checks the ad's category directory for the file and not the actual products table like the bulkupload.php script does. That is where the problem is coming from that we're currently experiencing and I initially posted about.

As an example, someone uploads an ad with a really common filename, then we find that ad would be more suitable in a different category so we move it, only to wipe out an existing ad's photo that is named the same with this moved-ad's photo.
silknet01 is offline   Reply With Quote
Old September 12th, 2008, 08:07 PM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
in handleupload try changing this

Code:
Content visible to verified customers only.
to this

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the name of existing link items in menu jeff260z Photopost Pro How Do I...? 3 April 6th, 2008 07:57 PM
5.62 Moving images can overwrite existing images Astaran Photopost Pro Bug Reports 11 December 24th, 2006 11:00 PM
can't watermark existing images.. curriertech Photopost Pro Bug Reports 6 September 11th, 2006 11:38 AM
User able to Upload Images without Check Neal-UK Photopost Pro Installation & Upgrades 3 April 5th, 2006 12:42 PM
Changing category images by user daveman1000 How Do I? - vBulletin 3.0.X 3 March 31st, 2005 10:29 AM


All times are GMT -5. The time now is 04:22 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0