I'm using Commerce Extra Address Populate to populate the Customer Address from an existing Address in the user profile. It just copies the address from an addressfield. But, I'm getting a validation error (Het veld Huisnummer is verplicht.). Please see the attached screenshot, that should clarify my issue. I hope you can help.

Thanks,

Mike.

CommentFileSizeAuthor
addressfield.png11.46 KBsportel

Comments

frans’s picture

Very hard to fix properly.. Didn't thought about using use existing fields. This module saves the triplet postcode, number and addition in the address seperatly.

From the addres alone is fetching those 3 things very difficult. Addresses with space, additions with spaces... additions can contain numbers (13b-1).. all kinds of problems.

Maybe we can disable the field on existing fields? Any ideas?

sportel’s picture

Yes, I understand the problem. A few years ago I already suggested to the maintainers of the Address Field module to store the number and addition separately in the db which I believe is actually supported by the xNAL standard (ThoroughfareNumber and ThoroughfareNumberAddition or something like that), but there was no support for that idea.

Maybe add token support? Or rules? Or maybe disable the requirement for the number field when the address is already populated? I don't know.
The best solution would probably be that the Commerce Extra module is patched or something.

frans’s picture

Does it help to have this module enabled on both fields? So that both fields have this postcode check enabled?

sportel’s picture

No, that doesn't help.

frans’s picture

Status: Active » Needs review

Tnx sportel,

Fixed in commit:
http://drupalcode.org/project/addressfield_nl_postcode.git/commit/550355...

Please use the 7.x-1.x development version and RTBC this issue, so we can go to a next minor release.

sportel’s picture

Hello Frans,

I've updated to the latest dev version, but can't find any difference. And, still the same validation error. What difference should I notice?

Mike.

frans’s picture

Hi Mike,

Please be sure that both fields have this module enabled. And that the source field (on your profile) works as expected, without errors.

In the module file itself there is a new hook hook_field_attach_load, that adds the huisnummer and addition to the value array, so that it get's copied over. (starting at r12).

I tested it with commerce extra, and it 'should' work :)

sportel’s picture

Status: Needs review » Reviewed & tested by the community

Hi Frans,

Yes, it works! I was using the same session after the update as before the update, and just refreshed the page. That's why it didn't work at first. Thanks for your help.

Mike.

frans’s picture

Ahh, yes, forgot to tell that you need to clear the cache :)

frans’s picture

Status: Reviewed & tested by the community » Fixed

Published in beta2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.