BluTiGeS Posted January 25, 2017 Share Posted January 25, 2017 (edited) Hi, I am still adapting my modules to 1.7 and seeing now problems in the backoffice tabs. Now I have the issue that the working 1.6 version with adaptions to 1.7 now displays at the hookDisplayAdminProductsExtra at the Products, but did not submit images and pdf files. Also if I dump the $_FILES, it is a empty array. So i checked the form upload and added debug output in the "hookActionProductUpdate". There I noticed that it got called 8 times instead of only once after pressing the save button. Does anyone know why this occurs? I wanted to update the DB and Upload a FIle at the hookActionProductUpdate, the select field got submitted but the previous workin files are not submitted. Was there a change in 1.7 ? Has anyone a working example of file upload at the hookDisplayAdminProductsExtra ? Many Thanks in advance Edited January 25, 2017 by BluTiGeS (see edit history) Link to comment Share on other sites More sharing options...
BluTiGeS Posted January 30, 2017 Author Share Posted January 30, 2017 Does anyone has a Idea how to get a image uploaded in the hookDisplayAdminProductsExtra Tab on the hookActionProductUpdate or the default save functionality in PS1.7? Link to comment Share on other sites More sharing options...
frankit Posted February 10, 2017 Share Posted February 10, 2017 (edited) I'm also trying to save extra product field displayed through hookDisplayAdminProductsExtra on 1.7, but the save ajax call retrns "This form should not contain extra fields", becuse I just loaded a tpl with a checkbox named form[modulename][value] as shown here, while I suppose I should use the prestashop methods to render the form. How did you add a file input field correctly to the module option section of the product? Thanks. Edited February 10, 2017 by frankit (see edit history) Link to comment Share on other sites More sharing options...
oidnus Posted February 15, 2017 Share Posted February 15, 2017 My ugly solution that fixed this problem public function hookActionProductUpdate($params) { $update = (int)Tools::getValue('mymodule_update'); if ($update==0){ //your code }else{ $_POST['mymodule_update'] = 1; } return true; } Link to comment Share on other sites More sharing options...
BluTiGeS Posted February 15, 2017 Author Share Posted February 15, 2017 Okay, this is a workaround for the multiple calls. Thanks for that hint. Do you also have found a solution for the failing image upload? Is it not possbile anymore using a default html form? Regards Link to comment Share on other sites More sharing options...
BluTiGeS Posted March 4, 2017 Author Share Posted March 4, 2017 Anyone has a solution for file uploads in the backoffice using the default hook hookActionProductUpdate ? Or is it really needed to add a custom ajax uploader only for the own module? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now