Superserver Posted December 10, 2013 Share Posted December 10, 2013 Upload product images on the local XAMPP works fine! The upload of product images on 1&1 server does not work. After upload a blank image subdirectory is created. The server does not report a PHP error. (Directory permissions are correct and the upload of logos or other images works!) Version der Server-Software: Apache PHP-Version: 5.4.21 PrestaShop-Version: 1.6.0.1 (Alpha) 1 Link to comment Share on other sites More sharing options...
Radu Posted December 10, 2013 Share Posted December 10, 2013 can you please tell me what do you mean by "blank image subdirectory"? Link to comment Share on other sites More sharing options...
Superserver Posted December 10, 2013 Author Share Posted December 10, 2013 (edited) presta 1.6.1 generated after the upload only empty directories. (without images) look at this > Edited December 10, 2013 by Superserver (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 10, 2013 Share Posted December 10, 2013 hello maybe it's related to hosting limitations related to image sizes? have you tried to upload small image? or just with different picture? can you verify it please? Link to comment Share on other sites More sharing options...
Superserver Posted December 10, 2013 Author Share Posted December 10, 2013 the same problem in other size. my server limit is high. (test images for upload 70-160kb) look at this > Link to comment Share on other sites More sharing options...
prestamax Posted December 10, 2013 Share Posted December 10, 2013 (edited) The permissions for the image folder are probably not sufficient for the server to upload images. Permission problems are often solved if you run php as cgi module. Not sure how 1&1 is handling this. Edited December 10, 2013 by prestamax (see edit history) Link to comment Share on other sites More sharing options...
Superserver Posted December 10, 2013 Author Share Posted December 10, 2013 The permissions for the image folder are probably not sufficient for the server to upload images. Permission problems are often solved if you run php as cgi module. Not sure how 1&1 is handling this. thank you, directory permissions are correct and the upload of logos or other images works! and yes, php runs as cgi. I test the upload of images at a second installation on a different server now. Link to comment Share on other sites More sharing options...
Superserver Posted December 10, 2013 Author Share Posted December 10, 2013 The problem is this php error message: [10-Dec-2013 20:30:25 Europe/Berlin] PHP Notice: Undefined index: save_path in /.../shop/controllers/admin/AdminProductsController.php on line 3655 Is this a core error of the alpha version or did I miss something? This error is not here on the local xampp, getting on all 1 & 1 servers. Link to comment Share on other sites More sharing options...
prestamax Posted December 11, 2013 Share Posted December 11, 2013 Strange, the referenced line 3655 in AdminProductsController.php is if ($this->product_exists_in_shop) Can you view the product you want to upload images to? Link to comment Share on other sites More sharing options...
Superserver Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) Strange, the referenced line 3655 in AdminProductsController.php is if ($this->product_exists_in_shop) Can you view the product you want to upload images to? sorry, this is not correct, the first call of the undefined variable (save_path) is >>> [AdminProductsController.php] public function ajaxProcessaddProductImage() { ... if (!ImageManager::resize($file['save_path'], $new_path.'.'.$image->image_format)) <<< LINE 3655 { $file['error'] = Tools::displayError('An error occurred while copying image.'); continue; } ... } Edited December 11, 2013 by Superserver (see edit history) Link to comment Share on other sites More sharing options...
Superserver Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) I have the bug isolated.the problem: (the validation of upload file will not run)you look at this >the problem > the resize function is called before the uploaded file is validated. this error is the cause of my previous upload trouble my english is not so good but the problem is found and I am tired after 12h presta core When can I report errors for v1.6 Alpha in PrestaShop bug tracker? Edited December 11, 2013 by Superserver (see edit history) Link to comment Share on other sites More sharing options...
prestamax Posted December 12, 2013 Share Posted December 12, 2013 (edited) Not sure if this is related, but I have read in another post that there is a bug in the imagemanager and your function in question refers to the image manager. in classes/ImageManager.php line 132 there is a condition if (!file_exists($src_file) || !filesize($src_file)) that is causing problems. Solution is commenting out the second part if (!file_exists($src_file) /* || !filesize($src_file) */) Maybe worth a try ... (or you could try if it works if you comment out line 3655 - 3659 in your AdminProductsController.php) Edited December 12, 2013 by prestamax (see edit history) Link to comment Share on other sites More sharing options...
Radu Posted December 12, 2013 Share Posted December 12, 2013 http://forge.prestashop.com however I didn't notice the same issue on my 1.6 install. If you try with a very small image, does it work? Link to comment Share on other sites More sharing options...
Superserver Posted December 12, 2013 Author Share Posted December 12, 2013 (edited) the bug has nothing to do with the file size !!! the validation of upload file does not run correctly. I can upload all file types. This bug also give rise to problems with uploading images on my 1&1 server. I have done a simulation, it is tried first resize without running the file validation and check file type. the correct way would be (anything else very unsafe!): 1 > product image upload 2 > upload file validation (size, type, ...) 3.1 > is true then copy file into the presta image directory 3.2 > is false then return and show error message 4 > calling on success the resize function and more the validation should be at the beginning without any further calls of functions. only then should follow more functional calls (eg resize). I hope this information will pass on to the developer team ... Edited December 12, 2013 by Superserver (see edit history) Link to comment Share on other sites More sharing options...
Vincent Terenti Posted December 13, 2013 Share Posted December 13, 2013 Hi Superserver, I created an issue, this bug will be corrected Thanks for your feedback! Best regards, Link to comment Share on other sites More sharing options...
ZiadJ Posted December 16, 2013 Share Posted December 16, 2013 (edited) I created an issue, this bug will be corrected Can you provide the link for the issue so that we can know when it has been fixed? I've been having issues uploading multistore product images in IIS. Not sure if this is related though. Edited December 16, 2013 by ZiadJ (see edit history) Link to comment Share on other sites More sharing options...
Vincent Terenti Posted December 16, 2013 Share Posted December 16, 2013 No problem http://forge.prestashop.com/browse/PSCSX-181 Best regards, Link to comment Share on other sites More sharing options...
ZiadJ Posted December 16, 2013 Share Posted December 16, 2013 http://forge.prestashop.com/browse/PSCSX-181 Thanks but when I enter the link I get this message: Permission Violation It seems that you have tried to perform an operation which you are not permitted to perform. Looks like the issue is not accessible to the public. Link to comment Share on other sites More sharing options...
Vincent Terenti Posted December 16, 2013 Share Posted December 16, 2013 Can you try again? I put security level : All users May be you can create an account if it's not working? Best regards Link to comment Share on other sites More sharing options...
prestamax Posted December 18, 2013 Share Posted December 18, 2013 Can't see it either (logged in) Link to comment Share on other sites More sharing options...
eleazar Posted December 19, 2013 Share Posted December 19, 2013 We discussed this bug of forge.prestashop.com already in octobre. Obviously since then nothing has changed. :-( Try my solution I posted here: http://www.prestashop.com/forums/topic/279614-problems-viewing-forge/?do=findComment&comment=1415029 Link to comment Share on other sites More sharing options...
Recommended Posts