← Back to team overview

magentoerpconnect-community team mailing list archive

Re: Magento 1.4.1.0 bug making troubles with Magentoerpconnect....

 

2010/6/24 Raphaël Valyi <rvalyi@xxxxxxxxxxxx>

>
>
> ---------- Forwarded message ----------
> From: Raphaël Valyi <rvalyi@xxxxxxxxxxxx>
> Date: 2010/6/23
> Subject: Magento 1.4.1.0 bug making troubles with Magentoerpconnect....
> [...]
>
>
> Hello,
>
> it looks like the brand new Magento release 1.4.1.0 has a small issue with
> creations of products via webservices, we find a similar issue as:
>
> http://www.fragento.org/Problemes-d-installation/33187-Magento-1.4.1.0-rien-ne-va-plus.html
> or http://www.magentocommerce.com/bug-tracking/issue?issue=9404
>
> In the connector, because our logging code is not optimal (I'm changing
> that tomorrow), when trying to upload products from OpenERP to Magento, it
> translates into an error such as:
> Magento error 103, SKU must be unique.
>
> But actually, because we can have network issues or even Magento inability
> to answer due to slowness, after a query fails we use to retry it 3 times
> after sleeping somewhat.
> So the first time is creates the product with its SKU in Magento but it
> gets back the URL rewrite bug so it tries again the same request twice.
> It will only log the failure at the end, so all the user/admin see in its
> logs is "SKU must be unique" while the original error was different (We are
> improving the whole logging).
>
> So what is wrong with Magento in v1.4.1.0 ?
> it looks like after the product creation it tries to rewrite the optimized
> SEO URL from the product name or provided key.
> But for some reason in Magento 1.4.1.0 it passes here twice!
> And because that URL rewriting entry must be unique it raises an exception
> that's why in OpenERP we try to re-send the product and get back the
> duplicate SKU bug!
>
> I didn't find a clean patch yet, but already found an acceptable workaround
> in Magento that will let URL rewriting working and avoid this error:
>
> inside magento/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Url.php
> comment out the line
> 253: Mage::throwException(Mage::helper('catalog')->__('An error occurred
> while saving the URL rewrite.'));
> into //Mage::throwException(Mage::helper('catalog')->__('An error occurred
> while saving the URL rewrite.'));
>
> Note that once done, you should really delete the created product in
> Magento before retrying to export the catalog to Magento.
>
> This will not prevent Magento to try to make a duplicate URL rewriting
> insertion, but at least, once MySQL raises an exception because this break
> the URL uniqueness constraint, then Magento will just stay quiet and don't
> return an error to OpenERP so the product will save normally and upload of
> other product will continue (notice that MySQL itself prevent the double
> insertion here so no data is corrupted).
> I hope that Magento will fix the bug in a better way and avoid the double
> insertion attempt in the future, we will help reporting them.
>
> Anyone confirming the bug/workaround?
>
> NB: we made a serie of commit on Magentoerpconnect trunk with a series
> of improvement regarding the payment managements (see previous post on the
> magentoerpconnect mailing list for explanations) and also some code clean up
> from OpenERP S.A. themselves (they will certify thoses modules, meaning they
> could provide 2nd level maintainance on them and will warranty compatibility
> with future OpenERP release).
> Also, I should say that I've been testing the connector with OpenERP v6
> (dev) those days and I have it all working so far (after my patches), so
> this is great; we are starting a v6 + Magento project already here in Sao
> Paulo.
>
> Hope this helps!
>
>
> --
> Raphaël Valyi
> http://www.akretion.com
>