Closed (fixed)
Project:
Address Field NL Postcode
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2013 at 08:01 UTC
Updated:
20 Jul 2013 at 22:31 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| addressfield.png | 11.46 KB | sportel |
Comments
Comment #1
frans commentedVery 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?
Comment #2
sportel commentedYes, 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.
Comment #3
frans commentedDoes it help to have this module enabled on both fields? So that both fields have this postcode check enabled?
Comment #4
sportel commentedNo, that doesn't help.
Comment #5
frans commentedTnx 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.
Comment #6
sportel commentedHello 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.
Comment #7
frans commentedHi 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 :)
Comment #8
sportel commentedHi 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.
Comment #9
frans commentedAhh, yes, forgot to tell that you need to clear the cache :)
Comment #10
frans commentedPublished in beta2