Make postal_code compatible with entity_metadata_wrapper's ->value() function.
Basically change postal to value on the item array. This should also solve some compatibility issues we might run into.

I will see if I can get around this later today, but until then I will leave this here as a reminder.

Comments

jeremyclassic’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
lslinnet’s picture

When you assign the value of the postal_code field, use the "value" array element instead of "postal_code" e.g.

$node->field_postal_code[LANGUAGE_NONE][0]['value'] = "1234";
// instead of
$node->field_postal_code[LANGUAGE_NONE][0]['postal_code'] = "1234";
lslinnet’s picture

Status: Postponed (maintainer needs more info) » Active
jeremyclassic’s picture

@Islinnet - please provide a patch. Your solution above does not fully solve the problem.

$node->field_postal_code[LANGUAGE_NONE][0]['value'] = "1234";
// instead of
$node->field_postal_code[LANGUAGE_NONE][0]['postal'] = "1234";

This will break current implementations of the field and does not have (as far as I can tell) an easy migration path to cleanup pre-existing fields.

I've attached a patch that does exactly what you're asking. Perhaps you could point me in the direction of information on, or supply a patch for, updating the field definitions.

jeremyclassic’s picture

Category: Feature request » Bug report
mustanggb’s picture

Status: Active » Needs review
StatusFileSize
new3.23 KB

Entity API integration is super handy, here is a patch that updates current installs to the new implementation (postal_code_update_7100()), and adds the final missing piece to allow integration (property_type and property_callbacks).

mustanggb’s picture

StatusFileSize
new3.7 KB

Actually might as well fix the whitespace in postal_code_field_info() as well.

mustanggb’s picture

StatusFileSize
new4.28 KB

Added an occurance that jeremyclassic missed.

mustanggb’s picture

Status: Needs review » Reviewed & tested by the community

Any maintainers around?