This a subissue of.
The Entity API module provides a hook called
hook_entity_property_info() with which metadata about entity properties can be defined. Ubercart Addresses provides the hook
hook_uc_addresses_fields() with which address fields can be registered. As each address field of an address is essentially a property of the upcoming address entity, it would be nice if property metadata can be defined in
hook_uc_addresses_fields(), so modules that register address fields don't need to implement
hook_entity_property_info() as well to define additional or similar information about their fields.
One metadata item is the data type of the field, simply called 'type'. This can be 'text', 'integer', 'boolean', etc. So, in preparation of the entity integration, it would be nice if the data type is declared for each field, which will fallback to 'text' for if it's not defined.
Though it would only have a function for the 7.x-1.x version, fields specifying their data types will also be implemented for the 6.x-2.x version for consistency (and the information *could* be useful for modules extending Ubercart Addresses as well).
The Ubercart Addresses Example module already used the 'type' property to define the database data type. The example module should be adjusted to remain compatible with future changes (Entity API integration).
Current registered address fields will get an extra property called 'type'. This will be mapped to Entity API property info later on. Optionally, other properties could be defined as documented by
- Define data types for each registered address field that should not be just text.
- Provide the default value 'text' for property 'type' in
Adjust Ubercart Addresses Example module.Fixed in
User interface changes
Modules registering address fields should from now on define the data type of their fields if it's not supposed to be just text. Optionally, they can define other properties as documented by
I'm working on it.
PASSED: [[SimpleTest]]: [MySQL] 2,331 pass(es).
PASSED: [[SimpleTest]]: [MySQL] 3,144 pass(es).
FAILED: [[SimpleTest]]: [MySQL] 2,809 pass(es), 0 fail(s), and 1 exception(s).
PASSED: [[SimpleTest]]: [MySQL] 2,682 pass(es).