Hi,

I'm trying to copy the contents between two different CCK fields. As instructed on the handbook page Copying data between fields with VBO, I'm using the "Execute arbitrary PHP script" action for this.

The first field is a plain CCK text field which contains a EAN ('field_ean'); the second field is an field of the "Amazon item" type, as provided by the 'Amazon' module, and it contains an ASIN ('field_legacy_asin'); 'field_ean' is the source, 'field_legacy_asin' the target for the intended bulk operation. 'Amazon' module is able to convert EAN to ASIN (feature request: #288577: 13 digit ISBNs / EAN support / converting to ASINs; it has been committed somewhere in 2010), and this works properly, if one pastes an EAN into the ASIN field manually.

In VBO, I've tried this PHP snippet:

$object->field_legacy_asin[0]['value'] = $object->field_ean[0]['value'];
node_save($object);

This does not work for whatever reason. Watchdog reports: "Error retrieving Amazon item AWS.InvalidParameterValue, message: 6301231783 is not a valid value for ItemId. Please change this value and retry your request."

I don't understand what the difference is if I'm manually pasting the EAN into the ASIN field compared to an automatic operation through VBO. Is there something else VBO would have to do to mimic manual copying & pasting?

Thanks!

Comments

bojanz’s picture

Project: Views Bulk Operations (VBO) » Amazon Product Advertisement API
Component: Actions » Miscellaneous

You'll need to ask in the Amazon queue. I'm not familiar with the validation that the module does.