In the methods commerce_*_property_info_callback the provided field name is changed $name = str_replace('_', '-', $field['field_name']);
This leads to a new entry in the &$info array.
After running through commerce_line_item_property_info_callback the &$info array looks like this

$info
  commerce_order
    bundles
      commerce_order
        properties
          line_items
            label  Line items  
            type  list<commerce_line_item>  
            description  Field <em class="placeholder">line_items</em>  
            getter callback  entity_metadata_field_property_get  
            setter callback  entity_metadata_field_property_set  
            access callback  entity_metadata_field_access_callback  
            query callback  entity_metadata_field_query  
            field  true  
          line-items
            options list  entity_metadata_field_options_list  

This structure leads to notices while running through entity_metadata_token_info_alter in entity/entity_metadata/entity_metadata.tokens.inc because it expects in every item a label key:
Undefined index: label File */entity/entity_metadata/entity_metadata.tokens.inc, line 55

I'm not sure how to act here.
Following question should lead to an idea for a fix :)

  • If the new item is added intentionally:
    • Is it applicable to add a label to the new key?
    • Should entity_metadata.tokens.inc be patched?
  • If the new item is added unintentionally:
    • Is it applicable to remove the name clean-up?
    • Is it applicable to clone and unset the old entry?

Comments

das-peter’s picture

Title: Issue wit commerce_*_property_info_callback » Issue with commerce_*_property_info_callback
rszrama’s picture

Status: Needs work » Closed (duplicate)