We should add a final hook just before the values are uploaded in the transpose() function so that other modules can modify them before they go out.

Comments

shabana.navas created an issue. See original summary.

shabana.navas’s picture

-

shabana.navas’s picture

Issue summary: View changes
shabana.navas’s picture

StatusFileSize
new1.16 KB
travis-bradbury’s picture

Status: Needs review » Needs work
+++ b/classes/commerce_amazon_mws.Mapping.php
@@ -115,6 +117,8 @@ class CommerceAmazonMWSTypeMapping {
+            drupal_alter('amazon_mws_variation_value', $value, $amazon_field_key, $drupal_field_key);

Should this be `amazon_mws_node_value` instead of variation_value? Or, if we're just doing one alter hook, should we pass in other information like the entity type or the entity itself?

shabana.navas’s picture

Yeah, good suggestion there @tbradbury. Since we're passing in most of the info already, it would be nice to pass in the entity itself as well. I'll go ahead and submit another patch with those changes.

shabana.navas’s picture

Updated patch. Changes added from recommendations in #5.

shabana.navas’s picture

Status: Needs work » Needs review
shabana.navas’s picture

StatusFileSize
new2.03 KB
mbreden’s picture

On the latest patch (-9), the second

drupal_alter('amazon_mws_variation_value', $value, $amazon_field_key, $drupal_field_key, $variation);

Will/might have an undefined $variation variable.