Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I can commit this as is, but I don't really know what it takes to have a full address in Brazil. : D
Just so we have the same understanding on what feels to include / require - are only fields that are actually required to mail something required right now? I'm not use to seeing you have to enter so much, including "neighborhood."
Patch seems to work fine as is, though, and I can commit any time.
Actually, I'm about to do some work to add the name fields in, and I don't wanna royally hose your dev repository. I'm going to commit as is and do my work, but please review based on my last comment. I'm guessing you'll need a follow-up patch to accommodate name information anyways.
Hi! I live in Brazil,
and it really needs to have some other fields
I already review the patch and according with this document http://xml.coverpages.org/XNAL-DTDs-display.html the fields are right!
So i can't see why this isn't commited, we really need this stuff :D
Here's a reroll from the proper folder. Reverted changes to "Sao Paulo", since it is the proper transliteration. It is wrapped in t() and can be translated to add proper diacritics (to all states).
@pedrorocha, neighborhood is usually asked, and it's important, since there are cities with duplicated street names. It should be translated into "Bairro" in pt-br.
Although "bairro" is a usual information when you think of Brazilian addresses, I seldom see them in web forms. Damn colonialism. Supporting is a good sign, and it serves the purpose of disambiguating duplicated street names.
Sorry, i understood as "referência", but after that i realized it was "Bairro". And obviously, i agree that it should be in every form.
I had a second thought on this case and i think that we could create a specialized module for a brazilian addressfield, because that's why Addressfield module uses CTools plugin system: we can extend it without the need to patch the main module. But i agree that this patch here is a good default and should be commited, without further problems(i'm using it right now).
Fixed some stuff on the previous patch and re-rolled it against latest -dev.
@barraponto, the street number must go together with the street address on the xNAL standard (according to rszrama in another issue). Yet, I also don't like storing them on the same field. In addition, premise is not supposed for this kind of value, even on google's schema.
@barraponto, regarding the order of the fields, I followed the Brazilian post office standard guides
Other Brazilians who used the module complained about the labels Address 1 and Address 2. It is fixed, using dependent_locality for "Neighborhood", or bairro in Portuguese. Be aware that google most times return this value as the type sublocality, yet they also have a type called neighborhood.
Other minor fixes:
Use uppercase for PHP constants, e.g. NULL, TRUE, FALSE
@Mac_Weber, you patch is trying to do too much, please clean this up with just the changes in the scope of the issue, leave the coding standards changes to another issue as it makes the patch hard to read and less likely to get in. Please fix code comments to start with capital letters and end with a full stop, again just for the changes in the scope of the issue. Make sure you just touch the parts related to BR.
Although, i came to another doubt that i think is needed to solve the "brazilian address issue": should "sub_premise" field be available too? In Brazil, is very common to have the "Street" separate from the "Number", and the integration with some payment providers in Drupal Commerce needs to improvise to handle this.
Comments
Comment #1
recidive commentedAn updated patch, making some more fields required and decreasing size of number field.
Comment #2
rszrama commentedI can commit this as is, but I don't really know what it takes to have a full address in Brazil. : D
Just so we have the same understanding on what feels to include / require - are only fields that are actually required to mail something required right now? I'm not use to seeing you have to enter so much, including "neighborhood."
Patch seems to work fine as is, though, and I can commit any time.
Comment #3
rszrama commentedActually, I'm about to do some work to add the name fields in, and I don't wanna royally hose your dev repository. I'm going to commit as is and do my work, but please review based on my last comment. I'm guessing you'll need a follow-up patch to accommodate name information anyways.
Comment #4
recidive commentedThere might have better xNAL properties for putting Brazilian address info. I'll check on this when I get the chance.
Moving to needs work.
Comment #5
sebas5384 commentedHi! I live in Brazil,
and it really needs to have some other fields
I already review the patch and according with this document http://xml.coverpages.org/XNAL-DTDs-display.html the fields are right!
So i can't see why this isn't commited, we really need this stuff :D
Cheers!
Comment #6
damien tournoud commentedThis patch needs to be rerolled.
Comment #7
rfsbsbHi,
Here's a new patch taken today.
Please review.
Comment #8
wundo commentedRerolling using previous if clause instead of creating a new if clause for the brazilian address .
Comment #9
barrapontoHere's a reroll from the proper folder. Reverted changes to "Sao Paulo", since it is the proper transliteration. It is wrapped in t() and can be translated to add proper diacritics (to all states).
Comment #10
pedrorocha commentedIs "Neighborhood" really needed? I'm from Brazil too and never sought a website asking me for it.
Comment #11
recidive commented@pedrorocha, neighborhood is usually asked, and it's important, since there are cities with duplicated street names. It should be translated into "Bairro" in pt-br.
Comment #12
barrapontoAlthough "bairro" is a usual information when you think of Brazilian addresses, I seldom see them in web forms. Damn colonialism. Supporting is a good sign, and it serves the purpose of disambiguating duplicated street names.
Comment #13
pedrorocha commentedSorry, i understood as "referência", but after that i realized it was "Bairro". And obviously, i agree that it should be in every form.
I had a second thought on this case and i think that we could create a specialized module for a brazilian addressfield, because that's why Addressfield module uses CTools plugin system: we can extend it without the need to patch the main module. But i agree that this patch here is a good default and should be commited, without further problems(i'm using it right now).
Comment #14
pedrorocha commentedAny news?
Comment #15
barrapontoI'd say breaking Brazilian Address stuff to a new module would be interesting, yet it's a matter of a follow up patch.
Let's commit this.
Comment #16
giorgio79 commentedThis should happen here #1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API
Comment #17
barrapontoI've been wondering whether 'dependent_locality' (a.k.a. Neighborhood) should go into the
street_blockorlocality_block.It doesn't look right when in locality_block, but I'm not really sure. It does affect the layout of both form and output.
Comment #18
rszrama commentedComment #19
halthAny news on commiting this!? It's very important for us Brazilians to have these fields on the form :)
Comment #20
mac_weber commentedFixed some stuff on the previous patch and re-rolled it against latest -dev.
@barraponto, the street number must go together with the street address on the xNAL standard (according to rszrama in another issue). Yet, I also don't like storing them on the same field. In addition,
premiseis not supposed for this kind of value, even on google's schema.@barraponto, regarding the order of the fields, I followed the Brazilian post office standard guides
Other Brazilians who used the module complained about the labels
Address 1andAddress 2. It is fixed, usingdependent_localityfor "Neighborhood", or bairro in Portuguese. Be aware that google most times return this value as the typesublocality, yet they also have a type calledneighborhood.Other minor fixes:
Comment #21
recidive commented@Mac_Weber, you patch is trying to do too much, please clean this up with just the changes in the scope of the issue, leave the coding standards changes to another issue as it makes the patch hard to read and less likely to get in. Please fix code comments to start with capital letters and end with a full stop, again just for the changes in the scope of the issue. Make sure you just touch the parts related to BR.
Thanks
Comment #22
mac_weber commentedre-rolled patch file following recidive's comments.
Comment #23
afeijoPatch works as expected, good job Weber ;)
Comment #24
mac_weber commentedI also tested removing the fields
Full nameandCompany, it works fine.How it looks like with this patch:
Edit:
View:
Comment #25
recidive commentedPatch in #22 looks ok to me. Can we get this in?
Comment #26
rszrama commentedThanks a lot, guys! Committed.
Comment #27
afeijoYAY !
No, thank you rszrama :D
Comment #28
barraponto@mac_weber so that's where we should send you a beer?
Comment #30
pedrorocha commentedGreat to have this field there!
Although, i came to another doubt that i think is needed to solve the "brazilian address issue": should "sub_premise" field be available too? In Brazil, is very common to have the "Street" separate from the "Number", and the integration with some payment providers in Drupal Commerce needs to improvise to handle this.
Does anybody agree?
Comment #31
mac_weber commented@pedrorocha I think you should open a new issue for that.
As a quick reply: sub_premise is not meant to be used as street_number by any known format.
I don't think addressfield will change it because they are following xNAL format, but their maintainers may answer it better.
Comment #32
mac_weber commentedClosing as this patch is already merged.
As said on #31, a new issue should be opened.
Comment #33
mac_weber commented@pedrorocha see #2059969: Add "ThoroughfareNumber" to the schema.
Comment #34
thiago78 commentedJust a question: How is this different from the solution given by: https://drupal.org/project/br_address ?