The error originates from app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php, when the default sorting field is not in the list of available sort orders. This is always the case when 'Use Default Config' is set, because then the list is empty.
I gather from the PHP code in this file that the connector should set up an array value for a field 'use_post_data_config' that contains 'available_sort_by' if 'Use Default Config' is set on the category. Also, the field 'available_sort_by' should then by absent from the list of values sent to Magento. Only then will it retrieve the list of default sorting fields to check if the sorting field for this particular category is valid.
I have added a mapping line to the template and it gets sent over the wire as expected. Unfortunately, when Magento reads it out using "$object->getData('use_post_data_config')" it is not there so my problem is not yet solved.
Here is the mapping line:
magentoerpconnect.mag1500_product_category_use_post_data_config,magentoerpconnect.mag1500_product_category,use_post_data_config,,out,function,unicode,,False,False,"use_config_fields = []
if 'default_sort_by' in resource:
cat_attr_option = 'None'
if resource['default_sort_by']: cat_attr_option = self.pool.get('magerp.product_category_attribute_options').browse(cr, uid, resource['default_sort_by'][0], context=context)
if cat_attr_option.value == 'None': use_config_fields.append('default_sort_by')
if resource.get('use_default_available_sort_by'):
use_config_fields.append(u'available_sort_by')
if use_config_fields:
result = [(u'use_post_data_config', use_config_fields)]
else:
result = []"
I would like to know if I am on the right path. Has anyone got a notion of this 'use_post_data_config' key, and do you think it should be used in the connector like I think it does?
Using Magento 1.6.1.0. Got the same problem.
The error originates from app/code/ core/Mage/ Catalog/ Model/Category/ Attribute/ Backend/ Sortby. php, when the default sorting field is not in the list of available sort orders. This is always the case when 'Use Default Config' is set, because then the list is empty.
I gather from the PHP code in this file that the connector should set up an array value for a field 'use_post_ data_config' that contains 'available_sort_by' if 'Use Default Config' is set on the category. Also, the field 'available_sort_by' should then by absent from the list of values sent to Magento. Only then will it retrieve the list of default sorting fields to check if the sorting field for this particular category is valid.
I have added a mapping line to the template and it gets sent over the wire as expected. Unfortunately, when Magento reads it out using "$object- >getData( 'use_post_ data_config' )" it is not there so my problem is not yet solved.
Here is the mapping line:
magentoerpconne ct.mag1500_ product_ category_ use_post_ data_config, magentoerpconne ct.mag1500_ product_ category, use_post_ data_config, ,out,function, unicode, ,False, False," use_config_ fields = [] 'default_ sort_by' ]:
cat_attr_ option = self.pool. get('magerp. product_ category_ attribute_ options' ).browse( cr, uid, resource[ 'default_ sort_by' ][0], context=context) option. value == 'None':
use_config_ fields. append( 'default_ sort_by' ) get('use_ default_ available_ sort_by' ): config_ fields. append( u'available_ sort_by' ) post_data_ config' , use_config_fields)]
if 'default_sort_by' in resource:
cat_attr_option = 'None'
if resource[
if cat_attr_
if resource.
use_
if use_config_fields:
result = [(u'use_
else:
result = []"
I would like to know if I am on the right path. Has anyone got a notion of this 'use_post_ data_config' key, and do you think it should be used in the connector like I think it does?