M.N Posted January 31 Share Posted January 31 Prestashop 1.7.8.11 but problem appeared already in v 10. PHP 7.4 Two shops with the same problem. When saving product, there will be error message Can not update product. However, text fields are updated, save button made gray. So, when going back to products list and opening product again, it can be saved for one time. Combinations can not be generated in this way. Looking at console there is strange issue with main.bundle.js file: POST https://xxx.xx/admin/index.php/sell/catalog/products/4?_token=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 500 (Internal Server Error) send @ main.bundle.js:1404 ajax @ main.bundle.js:1404 e.ajax @ main.bundle.js:1404 send @ form.js?1.7.8.11:677 (anonymous) @ form.js?1.7.8.11:876 dispatch @ main.bundle.js:1404 _.handle @ main.bundle.js:1404 VM532:2 Uncaught SyntaxError: Unexpected token '<', " <!DOCTYPE "... is not valid JSON at parse (<anonymous>) at Function.<anonymous> (main.bundle.js:1404:142314) at e.<computed> [as parseJSON] (main.bundle.js:1404:141046) at Object.error (form.js?1.7.8.11:729:23) at i (main.bundle.js:1404:78329) at Object.fireWith [as rejectWith] (main.bundle.js:1404:79198) at D (main.bundle.js:1404:130029) at XMLHttpRequest.<anonymous> (main.bundle.js:1404:132472) (anonymous) @ main.bundle.js:1404 e.<computed> @ main.bundle.js:1404 error @ form.js?1.7.8.11:729 i @ main.bundle.js:1404 fireWith @ main.bundle.js:1404 D @ main.bundle.js:1404 (anonymous) @ main.bundle.js:1404 load (async) send @ main.bundle.js:1404 ajax @ main.bundle.js:1404 e.ajax @ main.bundle.js:1404 send @ form.js?1.7.8.11:677 (anonymous) @ form.js?1.7.8.11:876 dispatch @ main.bundle.js:1404 _.handle @ main.bundle.js:1404 The line resulting error in file looks like this (starting with o.send...): t = t("abort"); try { o.send(e.hasContent && e.data || null) } catch (s) { if (t) throw s } By some reason Debug mode does not load up, but can use inspect in browser. Compared main.bundle.js size over with version 1.7.8.8, seems to be the same size. So can be that root cause is somewhere else. Where to look for? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted January 31 Share Posted January 31 Clear cache browser. Link to comment Share on other sites More sharing options...
M.N Posted February 1 Author Share Posted February 1 14 hours ago, Prestashop Addict said: Clear cache browser. Thank you for reply. This is tested from back office and manually deleting the folders. Unfortunately no change. Just noticed have written error message not correctly. Correct error message is: "Unable to update settings." when saving the product. Link to comment Share on other sites More sharing options...
JBW Posted February 1 Share Posted February 1 You need to check the browser XHR answer to see the error details (debug mode active) / or check server error log Link to comment Share on other sites More sharing options...
M.N Posted February 1 Author Share Posted February 1 Thanks for posters. Got debug result: CRITICAL 10:47:44 php Call to undefined method Product::updateCacheAttachment() Hide context Hide trace [▼ "exception" => FatalThrowableError {▶} ] {▼ /home/xxxxxxxxxxx/classes/Attachment.php:225 {▼ › › Product::updateCacheAttachment((int) $idProduct); › } /home/xxxxxxxxxxx/classes/Attachment.php:271 {▶} /home/xxxxxxxxxxx/src/Adapter/Product/AdminProductWrapper.php:858 {▶} /home/xxxxxxxxxxx/src/PrestaShopBundle/Controller/Admin/ProductController.php:574 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▶} /home/xxxxxxxxxxx/admin/index.php:82 {▶} } CRITICAL 10:47:44 request Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedMethodException: "Attempted to call an undefined method named "updateCacheAttachment" of class "Product"." at /home/xxxxxxxxxxx/classes/Attachment.php line 225 Hide context Hide trace [▼ "exception" => UndefinedMethodException {▶} ] {▼ /home/xxxxxxxxxxx/classes/Attachment.php:225 {▼ › › Product::updateCacheAttachment((int) $idProduct); › } /home/xxxxxxxxxxx/classes/Attachment.php:271 {▶} /home/xxxxxxxxxxx/src/Adapter/Product/AdminProductWrapper.php:858 {▶} /home/xxxxxxxxxxx/src/PrestaShopBundle/Controller/Admin/ProductController.php:574 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▶} /home/xxxxxxxxxxx/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▶} /home/xxxxxxxxxxx/admin/index.php:82 {▶} } ] What to look for next? Link to comment Share on other sites More sharing options...
M.N Posted February 1 Author Share Posted February 1 (edited) Products do not use attachments. Looked on database, all related to attachments is value 0. For different token generation changed all related values in configuration.php It clearly worked, as had to login and set some new passwords, but it did not resolve the problem. Edited February 1 by M.N (see edit history) Link to comment Share on other sites More sharing options...
M.N Posted February 2 Author Share Posted February 2 Great forum. Posted 24h ago error report and still "Waiting for approval by moderator"... Seems need to discuss it somewhere else. Link to comment Share on other sites More sharing options...
Mian Waqas Posted February 2 Share Posted February 2 On 1/31/2024 at 8:16 PM, M.N said: Prestashop 1.7.8.11 but problem appeared already in v 10. PHP 7.4 Two shops with the same problem. When saving product, there will be error message Can not update product. However, text fields are updated, save button made gray. So, when going back to products list and opening product again, it can be saved for one time. Combinations can not be generated in this way. Hello, 1. Turn on debug mode to see any errors 2. Downgrade your PHP version to 7.0 or 7.2 3. check PHP ini settings, and make it compatible with your store data amount. Regards Link to comment Share on other sites More sharing options...
M.N Posted February 2 Author Share Posted February 2 5 minutes ago, Mian Waqas said: Turn on debug mode to see any errors Yep, now this post with errors is waiting for moderator approval for 26 hours in the forum. In short: "exception" => FatalThrowableError {▶} ] {▼ /home/xxxxxxxxxxx/classes/Attachment.php:225 {▼ › › Product::updateCacheAttachment((int) $idProduct); Link to comment Share on other sites More sharing options...
M.N Posted February 2 Author Share Posted February 2 All my additional information is waiting for approval by moderator. Sorry, please if you can post your answers to https://stackoverflow.com/questions/77926156/cant-update-product-information Link to comment Share on other sites More sharing options...
JBW Posted February 2 Share Posted February 2 Looks like a inconsistency (maybe broken upgrade!?) in product class. Compare your classes/product.php with the original Prestashop one. Link to comment Share on other sites More sharing options...
M.N Posted February 2 Author Share Posted February 2 Thank you JBW! This was it, there was old version of Product.php used due to some override. Now solved, case closed. 27 minutes ago, JBW said: Compare your classes/product.php Link to comment Share on other sites More sharing options...
Prestashop Addict Posted February 8 Share Posted February 8 Check if you have an override by a 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