Troubleshooting the spinning save button in Prestashop 1.6.0.11 and above

It this article we will try to explain the reason behind the “spinning” save button on the product back office, that seems to be bothering merchants since Prestashop 1.6.0.11.

Update: possible Fix on Git

Here is a fix that came out recently, you can try replacing the red lines with green ones, or simply download the file and replace yours:

https://github.com/PrestaShop/PrestaShop/commit/5a0d4c90ff95332d8a03df84c5821c730a95087d

The issue: Save buttons on the Prestashop Product back office keep spinning (almost) forver

Ever since the release of Prestashop 1.6.0.11, many users of the Prestashop forums have reported the same, big issue that seemed to be affecting all upgraded versions of the software. The fearsome glitch being an absolute catastrophe for merchants, since it made it impossible to save the product page in the back office. Thus, impossible to edit or add products whatsoever.
Given that is one of the worst issues the Prestashop back office ever had, what is the cause of it? I fired an out-of-the-box 1.6.0.11 myself on my localhost and sought for a reasonable explanation: the save button keeps spinning until all tabs are loaded via ajax. This means that until all of them (Information, Prices, Combinations and so on) are fully loaded, it won’t be possible to even save the product. Let’s have a look at a screenshot to better understand what’s going on under the hood while the button is disabled:

Ajax calls in the prestashop 1.6 back office

Notice how many ajax calls to the same page are performed, with the last one still pending response. Each of them fetches the content of a tab, and it won’t ever be possible to save the page before everything has been loaded.

Unfortunately, the back office being slower and slower the more Prestashop versions are released, the waiting time might become unsustainable. It took 10 seconds on that localhost test, but it can grow up to one minute, or even more, on shared, medium quality hostings.

The reason behind it

In the end, it all comes down to a question: why wasn’t this happening before? Simple: it was indeed possible to save before all tabs had been loaded, however this ended up spawning the well known “Product must be in the default category” or “link_rewrite field is required” errors, which were indeed caused by saving the product form without all the necessary fields having been filled with the required data yet. We can think of the spinning button as a measure to prevent this kind of error.

Troubleshooting the issue

Given that it’s a matter of timing, let’s try to go over some possible fixes that came up in the constantly updating forum thread (Prestashop 1.6.0.11 problem with saving products).
Make sure you also enable error reporting by setting PS_MODE_DEV to true in config/defines.inc.php before even thinking of troubleshooting.

Identifying the source

Broken Ajax calls in the prestashop 1.6 back office
There are three possible scenarios: a broken entry in the ajax requests queue, that will show up in red (see previous screenshot) in the list mentioned above; a forever pending request; lastly, a really slow request. It is important to understand which of these is preventing the button from being clickable, as the long-term fix will vary depending on it. Make sure you wait a couple of minutes and keep an eye on the following timing column as well:

Prestashop slow back office product page

Once we are relatively sure about the type of issue, how can we find out the source?

First, you can tell the tab name by the url:

index.php?controller=AdminProducts&token=aeaf41a133dadba136c21930b7caa933&id_product=1&action=Suppliers&updateproduct&ajax=1&rand=1423043161452&_=1423043155352

In this case, you can see action=Suppliers, so we’re dealing with the suppliers table. If it’s a module, it will be action=Module*ModuleName* without asterisks of course.

In the case of a red entry make sure you check out the ajax response by clicking on the broken url itself, it should give you more insights on what’s wrong with it.

Case 1: Broken Module

The most common source of the error is a broken module. Inspect the name as above, and if it really is a module go ahead and disable it; it should fix the big issue while you figure out the underlying cause.

Case 2: broken product tab

This is worse than the previous, as it can’t be solved by simply disabling a module. Once you are sure it really is a tab (see above), there are multiple things you can do. If it’s a red entry and the response is a Prestashop Exception or PHP error, follow the hints given by the error itself. Common issues might come from:

  • A hard-modified AdminProductsController.php
  • AdminProductsController.php override
  • Broken/incompatible methods coming from other overrides

If you didn’t modify the original controller, you can temporarily disable all overrides by reaching Advanced Parameters > Performance and setting Disable all overrides to yes.

If you are not using overrides, the issue might be coming, yet again, from a module. Reach Modules > Positions, check “Display non-positionable hooks”, and then look for modules hooked to one of the following:

  • actionAdminControllerSetMedia
  • displayBackOfficeHeader
  • actionProductUpdate
  • actionProductAdd
  • actionCategoryUpdate

Wrapping it up

This post was not meant to give you a 100% reliable solution, since it’s impossible to predict every single scenario. Still, I hope it pointed you to the right direction in case you were facing the never-ending spinning save button issue in Prestashop 1.6.0.11 and newer.

You like the tuts and want to say "thank you"? Well, you can always feel free to donate:

  • Michael

    Guys please before you do anything or make any changes, call your hosting company and check your server logs, I did fix this by simply increasing the memory. Because the back end product page was consuming too much of it, also disabling some of the plugins help.

  • CtrlCode

    [SOLVED] Prestashop 1.6.1.17 – timeout problem – in js/admin/product.js file in line 124 change ajax timeout.
    In products.js AJAX timeout is set to 30000 My XHR GET’s takes 32s, so i just change it to greater number.

  • Davide

    Hi, what do you mean with “If you are not using overrides, the issue might be coming, yet again, from a module. Reach Modules > Positions, check “Display non-positionable hooks”, and then look for modules hooked to one of the following:”

    what do I have to check? How can I know if a module is hooked in a position it’s not supposed to be?
    thanks for your support

    • NemoPS

      You just need to check if you have any module hooked to those hooks I mention. If so, disable them and see if the issue is solved. It means one of them is breaking the page

  • Zubair Arshad Rana

    The working easy solution:
    go to admin->theme->default->templates->controllers->products->informations.tpl
    search for

    {l s=’Save’}

    change to
    {l s=’Save’}

    disabled=”disabled”

    * Now it will start to load fully and will work definitely
    You can also do it with ‘save and stay’

  • indiana71

    I installed from scratch v 1.6.1.2 with multiple store enabled. My provider is TopHost.
    If I see debug in FireBug Console I notice the error “509 Rate Limit Exceeded” when I open the product detail.

    What I can do?

  • http://doc.prestashop.com Xavier B.

    This should be fix in version 1.6.1.2 of PrestaShop : http://build.prestashop.com/news/prestashop-1612-maintenance-release/

  • Will

    Top notch solution working for me after facing again the same issue: check out https://www.prestashop.com/forums/topic/393218-16011-problem-with-saving-products/page-7

    ———–

    WORKS FOR 1.6.0.14

    Using FTP go to “admin > themes > default > template > controllers > products” and in all .tpl files find:

    {l s=’Save’}

    {l s=’Save and stay’}

    1. Remove ” disabled=”disabled ”

    2. Replace “process-icon-loading” with “process-icon-save”

    The results should be:

    {l s=’Save’}

    {l s=’Save and stay’}

    NOTE:

    I used Dreamwaver to open all files from the >>products folder and then I used “Find and Replace” tool to search and replace in all files at once.

    Save all files and you’re done!

    Edited by Sorodocul, 10 March 2015 – 09:23 AM.

    • NemoPS

      It might work as a trick but you would probably come across the “link rewrite is required” or “product must belong to the default category” errors, this way.

      • Will

        Well at first I just changed the code line for the save button and I had these errors messages. Why changing only one line? I got interrupted and forgot the second line… Still I tried to load a product just to have a look. Then after changing both lines things were fine and now I am justing loading products at the speed of light. After a couple of tens of products loaded no error messages and it works just fine.

    • zinger

      works fine for me!

    • http://bioscopeblog.net/ Mazedul Islam

      Thanks a lot. It works for me.

  • Will

    I was all stuck and nothing could help it, I then in Advanced Parameters => Performances I enabled “overrides”, Then things were cool again. Don’t know if that was the issue but now it works.

  • http://www.fly-watches.com Fly Watches

    Grazie Nemo. I am replying to the forum as we speak. :(

  • http://www.fly-watches.com Fly Watches

    Is this still the same issue in 1.6.0.14? I am definitely seeing slow loading of the save button as well as modules.

    • NemoPS

      Correct, sadly, it’s still the same issue :(

  • b_pcmaster

    i just found a better solution please check that post and let me know if that works for you?

  • NemoPS

    I Totally agree. They should completely get rid of ajax in the product editor, it’s so (so!) slow, and getting slower and slower. Talking about the back office in general, if you don’t ever check the new orders/customers/messages icons at the top (notifications), they will soon kill your bo.

  • http://pelechano.es Enrique Gómez

    This is just a bad design decission that makes the Product Admin really slow.
    I’m not talking about the spinner, but rather the fact that each section should be managed (saved) indepentendly via ajax and not all at once.

    Thanks Fabio por your articles

You like the tuts and want to say "thank you"? Well, you can always feel free to donate: