Closed (fixed)
Project:
Addresses
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
24 Feb 2010 at 17:43 UTC
Updated:
19 Aug 2010 at 02:50 UTC
Jump to comment: Most recent file
I get the following error both when I try creating new content using this cck field or editing the field directly: "Could not find as a province from . Try to use the province abbreviation or number."
When managing the fields on the content, it makes the province field in the "default" section required and pops up this error when I try to save it. I was thinking that I might have to select a country so that it could validate the province (the first blank) from the country (the second blank). I had the country field hidden previously, and it doesn't show up in the default section.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | addresses-724548.patch | 1.04 KB | mikeytown2 |
| #7 | addresses_province_fix.patch | 1.17 KB | codycraven |
Comments
Comment #1
IncrediblyKenzi commentedSeeing this as well, but in the configure section of the cck content type.
Steps to reproduce:
Install content_profile module
Edit the Profile type, add an addresses field
Save the profile type
Click on "Manage Fields"
Click on "Configure" next to the addresses field
Modify the data in the field (e.g. add "City")
Click Save configuration
Results in the above message. This also prevents me from modifying the addresses field; the alternative is to remove and recreate the field, which isn't optimal.
Comment #2
IncrediblyKenzi commentedQuick update on this. If I specify a default value for both Country and Province, the form submits fine. Sounds like an exception needs to be made in the settings form submit handler.
Comment #3
davidneedhamAgreed. I made a new address field and made the country field visible. I haven't had any problems at all with it now.
(note: I also installed the dev version to get the handy state/province dropdown.)
Comment #4
mikeytown2 commentedDitto; issue had to do with importing the CCK field, the country was set to NONE, thus the check failed. Quick fix was to disable form_set_error in addresses.settings.inc
Comment #5
mikeytown2 commentedComment #6
codycraven commented[edit] I take this back, this is a bigger issue than I thought - fix is in the works
Comment #7
codycraven commentedPlease test
Comment #8
codycraven commentedComment #9
stephesk8s commentedThis worked perfectly for me. Thanks!
Comment #10
tboornaz commentedI tried the fix. It takes the error away but when I enter a value such as CA I get the following error:
Could not find CA as a province from . Try to use the province abbreviation or number.
Comment #11
codycraven commentedtboornaz,
Mmm I thought I addressed that issue, did you set a default country in the default settings for the CCK field?
Comment #12
bgilday commentedI have been able to replicate the steps that cause this issue. If at any time you set the Country configuration to hidden, country also gets removed as a default option and you run into the above province error message. Once you set Country to hidden, you are not allowed to set it back to another option such as normal or required.
Comment #13
DanielJohnston commentedYup, same thing happening on my installation. Leaving country and province blank while editing field settings appears to be a no-no.
Comment #14
tboornaz commentedI had the country set to none. I set the country to normal and that prevented the error or warning. Thank you.
Comment #15
letapjar commentedThe patch at least allows one to change country from hidden to some other value. However, when country is set to hidden, the error still occurs. This is a regression from the previous version of the module. One should be able to hide the country field from the form but still be able to set a default country value i.e. removing choice of country from the user completely and not showing the form element. Apparently when the country visibility is set to hidden the module also throws out the default country selection causing this error even with the patch.
Comment #16
mikeytown2 commentedGoing to migrate my addresses data to the location module. Location is overkill but a least it's not crippled. Oh well... #300609: Distinguishing projects: Addresses from Location
In case anyone else wants to take the plunge...
#740970: Migrate data from Addresses Module to Location CCK Module
Comment #17
codycraven commentedshifthappens and letapjar,
Thank you for the feedback. I will address the issue and provide a fix in a new release as soon as possible.
[note to mikeytown2 removed after his post was altered]
Comment #18
mikeytown2 commentedCall it my frustrations with all modules that deal with the physical world.
#594670: State Of This Module - my rant on the location module.
I have yet to find a module that "just works"; I'm just a little ticked that nothing works as advertised & as a result all the GEO modules keep getting fragmented since people keep making new ones.
http://groups.drupal.org/node/21723
http://groups.drupal.org/node/36976
http://drupal.org/project/modules?filters=drupal_core%3A87%20tid%3A65&so...
Sorry if I offended you, but I know the code above will be useful to someone since I couldn't find code for transferring data from addresses to location.
Comment #19
codycraven commentedmikeytown2,
I can absolutely understand the frustrations with all of these address/geo related modules. From a development standpoint they are not easy to do correctly. I came on with this module only a few months ago and have been working to bring it to a really usable level after finding that Drupal did not have a quality solution, instead of fragmenting off and creating my own. Unfortunately a lack of community testing is what caused this issue to get by in a release which is something that I can't do much about without community testing.
My goal is to release 2.x with many, many improvements that make the module worth while, however it is not an easy task, nor one with a small time commitment.
Comment #20
graper commentedfor anyone that found this post Like I did, there is a reply in the middle somehwere that is dated April 13th, while I found ones below that were dated earlier. I think it's a themeing/css issue that is not bumping them out in thread form. Maybe it's a setting in my profile.
Regardless, the patch works in that it will allow you to change the settings of the country to normal. At which point you should be able to set a default. You just need to make some css to not show it if you don't need it. My client needed it shown because they want to do both US and Canada, so no issues for me. The state now becomes a drop down also, which is nice.
In all honsty, the area that allows the choice of defaults should never have anything hidden, otherwise how do you hide something but then default it to something? I noticed that it also adds (maybe it was always there) "hidden" as an option. maybe that is what is needed to keep it in the defaults section but not shown to users.
hope this helps people.
Comment #21
wojtha commentedI can confirm that patch in #7 fixes the issue and suggesting RTBC status for this issue.
Comment #22
codycraven commentedCommitted patch from 7 -- graper, wojtha, stephesk8s thanks for the review on the patch.
This still needs work as pointed out by shifthappens, letapjar, DanielJohnston, bgilday, tboornaz so I am marking it as needs work even though a patch has been committed.
Comment #23
timos commentedJust to confirm i tested the patch #7 too and it seems work
Comment #24
scotwith1tI must say, the dev version as of today works like a charm as a solution and is already an improvement. Love the dropdown for states, makes it so much easier. eliminated errors above too.
Comment #25
AlexisWilke commented#7 was checked in, it is likely that this works now, indeed. I think I saw that code. I would also be 1.09.
Thank you.
Alexis
Comment #26
mikeytown2 commentedTested on 1.09. Going to disable form set error like I did in #4. I have Country set to None. Recommend adding in a default country to the cck widget, or not checking if no country is set.
Patch/Hack attached for anyone who is in the same situation as me.
Comment #27
mikeytown2 commentedComment #28
AlexisWilke commentedmikeytown2,
Sorry... I guess I'm a little slow at times. I added the correct fix in 1.x.
The fact is that if both $country and $province are defined, then we can test. Otherwise, they are not required and thus the validity test here is not required. We cannot know whether the province is correct if we don't know the country and if not required, the empty string for a province is valid too.
Let me know if that doesn't fix your problem.
Thank you.
Alexis