♥stubbsy Posted March 2, 2006 Posted March 2, 2006 Hi there, I have a problem in that if i edit category name etc when I save it the adjustments i have made to any words get saved, but any image which had already bee saved doesn't get saved and i get text at the top saying no file saved. I have replaced my categories.php with a stock one but i still have the same problem Can anyone advise where else to look? Thanks Stubbsy
gscreations Posted March 2, 2006 Posted March 2, 2006 Hi there, I have a problem in that if i edit category name etc when I save it the adjustments i have made to any words get saved, but any image which had already bee saved doesn't get saved and i get text at the top saying no file saved. I have replaced my categories.php with a stock one but i still have the same problem Can anyone advise where else to look? Thanks Stubbsy The message always appears when you do not upload an image, so dont worry about it, unless your images are dissappearing, have a look when you do this, are your images still there? Yes - fine the message is just telling you that it did not upload an image. No - ahh then you may have a problem.
♥stubbsy Posted March 2, 2006 Author Posted March 2, 2006 Yes, the image is disappearing. I specify an image and it appears, then if i edit the name of the category and hit save, then the image which was specified disappears.
leehayes Posted March 29, 2006 Posted March 29, 2006 I am now getting this problem. Any ideas anyone? Thanks
lonnieborntreger Posted April 4, 2006 Posted April 4, 2006 There seems to be a bug in admin/includes/classes/upload.php. Most likely it is only a problem in php4 (that is what I use). Line #80 of categories.php has: if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) { However, this is always returning an object. On line #30 of admin/includes/classes/upload.php, it has "return false" when it fails to find a file to upload. However, according to the post by "Wolverine" on Feb. 1 2006 on php.net's documentation ("Chapter 18. Classes and Objects (PHP 4)"), this will cause a partial class to be created, instead of the expected failure to create a class. Since an object is created, it does the database update to categories_image in TABLE_CATEGORIES -- with an empty file name. According to Wolverine, the fix is to replace the "return false" on line #30 with: $this = false; return; I made that change and verified that it works.
♥stubbsy Posted April 10, 2006 Author Posted April 10, 2006 Thanks for the info, will give that a go. cheers stubbsy
♥stubbsy Posted April 10, 2006 Author Posted April 10, 2006 Great, that works fine :) Thanks for that stubbsy
Guest Posted May 27, 2006 Posted May 27, 2006 I also have this problem. Any time I change/edit a category description/name/etc, the image I had uploaded disappears and I have to re-uploaded. I looked in admin/includes/classes .. and there is no upload.php. I installed the cart in December, so it's the latest. PHP is 4.3.11 Any ideas? It's not overly important, but just a pain.
nate_02631 Posted May 28, 2006 Posted May 28, 2006 If you indeed have the latest osC that file is there, otherwise you wouldn't be able to upload anything ;). Make sure you're looking in the right place and that you're not using a third-party hacked version of oSC... P.S. This mod worked great for me, too! Thanks! ** Please do not PM with personal support requests (even if offering "payment"). Thank you.
abra123cadabra Posted June 21, 2006 Posted June 21, 2006 Thanks a lot! This little code change now really keeps my images in the categories when I only update other things and save. abra The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.
benspun Posted December 4, 2006 Posted December 4, 2006 According to Wolverine, the fix is to replace the "return false" on line #30 with:$this = false; return; I made that change and verified that it works. I have the same little bug (the images of the categories is deleted if I don't specify it again when editing aa category). Not the end of the world, but would be nice to solve it. I am using php v5.0.4, and the solution of Wolverine doesn't work for me. It gives me this error: Fatal error: Cannot re-assign $this in c:\wamp\www\shop\admin\includes\classes\upload.php on line 30 Any idea how could I fix that? Thanks
tigergirl Posted April 19, 2007 Posted April 19, 2007 Thanks! This bit of code worked perfectly for me. On line #30 of admin/includes/classes/upload.php replace return false; with: $this = false; return; Took me a while to find the post but will save me much time in re-adding the images in categories and manufacturers every time I make a change - that was SO doing my head in! THANK YOU!!! :thumbsup: I'm feeling lucky today......maybe someone will answer my post! I do try and answer a simple post when I can just to give something back. ------------------------------------------------ PM me? - I'm not for hire
all2coolnick Posted May 28, 2007 Posted May 28, 2007 This is correctly solved by the following contribution. http://www.oscommerce.com/community/contri...egory+image+fix
Recommended Posts
Archived
This topic is now archived and is closed to further replies.