According to hook_rules_data_info() documentation:
property info: (optional) May be used for non-entity data structures to provide info about the data properties, such that data selectors via an entity metadata wrapper are supported. Specify an array as expected by the $info parameter of entity_metadata_wrapper().
according to entity_metadata_wrapper() documentation:
property info: (optional) May be used to use a wrapper with an arbitrary data structure (type 'struct'). Use this key for specifying info about properties in the same structure as used by hook_entity_property_info().
according to hook_entity_property_info() documentation:
properties: The array describing all properties for this entity. Entries are keyed by the property name and contain an array of metadata for each property. The name may only contain alphanumeric lowercase characters and underscores.
The structure of uc_shipment in uc_shipping_rules_data_info() is like this:
$entities['uc_shipment'] = array(
//...
'property info' => array(
'sid' => array(/*...*/),
'order-id' => array((/*...*/), // WRONG: Should be order_id - hyphen is not allowed.
'origin' => array(/*...*/),
'destination' => array(/*...*/),
'shipping_method' => array(/*...*/),
'accessorials' => array(/*...*/),
'carrier' => array(/*...*/),
'transaction-id' => array(/*...*/, // WRONG: hyphen is not allowed.
'tracking-number' => array(/*...*/), WRONG: hyphen is not allowed.
// ...
),
//...
);
What is wrong if name contains hyphen? Try to create a schedule rule on A shipment is saved event for example, and add an action to Schedule component evaluation with date selector shipment:ship-date or shipment:expected-delivery then click Save. The form will not validate saying that the parameter is incorect.
Patch will be provided.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | Issue-2323887-1.patch | 3.27 KB | SilviuChingaru |
Comments
Comment #1
SilviuChingaru commentedFixed!
Comment #5
longwaveCommitted, thanks for the report and patch!
Comment #7
SilviuChingaru commentedGlad I could help. You're welcome, as always. ;-)
Comment #8
SilviuChingaru commented