Jump to content

Save Product fails 9/10 times.


xertion

Recommended Posts

We have an issue with saving or updating products in our store. When we create a new product, add name "HelloWorld" and try to save the product by clicking "Save and Stay", the page refreshes with a blank Name-field and the information added before clicking the Save button is gone.

 

I've checked the following things:

  • I've used Google Chrome's Network Tab to confirm that the POST request actually contains the new value. It does.
  • I've double checked the MySQL database to make sure that there is no empty rows being created on the failed calls. This does not happen - no data is created or updated in the database on the failed calls.
  • I've checked var/log/apache2/error.log for errors that fit the timestamp of when I save the product. No errors are reported.
  • I've checked Google Chrome Console for Javascript errors. No Javascript error is output.
  • I've checked var/log/mysql.log and var/log/mysql/error.log. No errors that match the timestamp is present.
  • I've set define('_PS_MODE_DEV_', true); in defines.inc.php to see if any debug messages are output. There is no. 

In the case when we Update products, the old information is there after the page refresh. So the issue is not that it writes data to null, the problem is that it never write any data at all.

 

If we repeat this process ~10 times it will sometime succeed with a green success message, but most of the time it fails without any error being returned in the frontend or in logs.

 

I've encountered this on two separate installations of Prestashop (one 1.6.1.4 and one 1.6.1.5) on the same server. My suspicion is that there is something in the server environment, combined with bad error handling or a bug in Prestashop that cause this error.

 

We've had the sites up and running since Prestashop 1.6.1.5 release without issues. These problems started happening just a few weeks ago but has persisted since then. We have not changed or updated the server either. I've asked the Server Admins to check if the server have run out of memory or storage in any of the partitions. It has not - all partitions is available so any temporary files created should have space available for them.

 

At this point I feel like I've looked into it all but I still can't find the cause of the problem. Any ideas? Anyone ran into similar issues?

Edited by xertion (see edit history)
Link to comment
Share on other sites

I think this is because Google Chrome have stopped "allowing" depracted commands. So old coding techniques are no longer tolerated. You may find that Chrome has recently updated itself to the latest version

Link to comment
Share on other sites

I think this is because Google Chrome have stopped "allowing" depracted commands. So old coding techniques are no longer tolerated. You may find that Chrome has recently updated itself to the latest version

This seem to be the correct answer to the issue. I tested with Firefox and it seems to work 100% of the time after I tried updating a product ~10 times or so.

 

However - one thing that still is unanswered is how come Google Chrome would allow Prestashop to run the Javascript SOMETIMES but not all the time. As I described in the first post, if I save the product in Google Chrome 10 times, it might work once or twice. If it was just that Prestashop used deprecated/old methods it should not work at all. Confusing.

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...
  • 1 month later...

Hi all,

This crash error occurs only when you click on the <i> item (icon)

<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> Save</button>

 

If you press the bottom of the button where the text is located or the sidebar around the icon where the padding is located, the storage function will work.

Link to comment
Share on other sites

  • 1 year later...
On 7/28/2017 at 12:56 PM, oracle178 said:

Hi all,

This crash error occurs only when you click on the <i> item (icon)

<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> Save</button>

 

If you press the bottom of the button where the text is located or the sidebar around the icon where the padding is located, the storage function will work.

Good

After the last line of informations.tpl you can add this 

<script type="text/javascript">
    $(document).ready(function(){
    $('body').on('click', 'i.process-icon-save', function(ev){
        ev.preventDefault();
        $(this).parent().trigger('click');
    });

    });
</script>

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...