No error handling when the weight on Magento is not a float

Bug #1299721 reported by Karsten Kinateder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Connector - Magento
Confirmed
Medium
Unassigned

Bug Description

As example:

In Magento the product eav attribute "weight" is a system attribute and cant be changed from Magento Backend. There is no field validation in 1.7-1.8.1 for this field and the type is text in Magento Backend.

So it is possible, that a Backend User types "50 kg" or makes a typo in that field. Connector expects a float and throws exeption cause text is synchronized from magento.

Q&D: UPDATE 'eav_attribute' SET 'frontent_class' = 'validate-decimal' WHERE 'attribute_code' = 'weight'
to correct errors: UPDATE 'catalog_product_entity_text' SET 'value' = CAST(value as DECIMAL(10,2)) JOIN 'eav_attribute' USING 'attribute_id' WHERE 'attribute_code' = 'weight'

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

Thanks for reporting.

I propose to check if the weight is float during the mapping and to not import it if not, with a log message saying that it couldn't import the weight.

Changed in openerp-connector-magento:
status: New → Confirmed
importance: Undecided → Medium
summary: - No errorhandling for Magento Backend User typos
+ No error handling when the weight on Magento is not a float
Revision history for this message
Karsten Kinateder (karsten-m) wrote :

I would try a type convert, before rejecting the import.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Yes, that's what I had in head, but what I wrote was not sufficiently precise indeed.
Thanks

Revision history for this message
Karsten Kinateder (karsten-m) wrote :

Not really, when I read second time, we both proposes same. I honk had read to fast.

P.S.:
Have found a typo and iam not so familar with launchpad. Have just started.
Need this a bug report?

https://code.launchpad.net/~karsten-m/openerp-connector-magento/openerp-connector-magento/+merge/214318

Revision history for this message
Katja Matthes (katja-matthes) wrote :

Hello,

I just related a branch with our current solution to this problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.