I'm in a situation where my requirement for the data changes, this means that sometimes I want to store a simple address and sometimes I want to store a more complex address.

The thing is that right now the handlers used is fixed, meaning that I would have to use form alter which usually is complicated or I would have to create my own widget. It would save me a lot of hazzle if we could do add an alter before addressfield_generate is called in hook_field_widget_form and hook_field_formatter_view.

Comments

damien tournoud’s picture

Could you make a patch to add a hook_addressfield_handlers_alter(&$handlers, $address, $context)? (please add the documentation to addressfield.api.php too).

googletorp’s picture

Status: Active » Needs review
StatusFileSize
new3.92 KB

I've created a patch for this.

googletorp’s picture

Updated the patch and commited it to my sandbox: 6ebbc18

jenlampton’s picture

Issue summary: View changes
StatusFileSize
new3.16 KB

This is looking good to me, but needed a reroll.