JayDatamex Posted November 18, 2010 Share Posted November 18, 2010 Hi, I'm new here and new to using and developing for PrestaShop.I've created a custom Admin Module to handle product reviews which all appears to be working smoothly apart from the fact that every time I create a new record it is being inserted into the database twice.For the life of me I can't work out why this is happening. My assumption is that postProcess() is being called twice on the same page. I'm not sure why, or how this might be.If anyone could shed any light on this I'd be grateful. AdminProductReviews.php Link to comment Share on other sites More sharing options...
JayDatamex Posted November 19, 2010 Author Share Posted November 19, 2010 Well, I'm still not quite sure what was happening, but I discovered that the hidden field in the form that held the record ID number was using the wrong variable. A few changes and all seems to be OK now. Updated module file attached if anyone else wishes to use it. AdminProductReviews.php Link to comment Share on other sites More sharing options...
JayDatamex Posted November 29, 2010 Author Share Posted November 29, 2010 Actually, this turned out to be nothing to do with my code.I think the double database insert is caused by some kind of bug in the way PrestaShop handles it's cookies.I've started seeing this double record entry appearing more and more, and it's always when I've left my browser open for days on end. If I quit all browser windows then re-open and log back in to the Back Office the error goes away.Hope that helps someone. 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