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.

Comments

IncrediblyKenzi’s picture

Seeing 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.

IncrediblyKenzi’s picture

Quick 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.

davidneedham’s picture

Agreed. 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.)

mikeytown2’s picture

Ditto; 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

mikeytown2’s picture

Category: support » bug
codycraven’s picture

[edit] I take this back, this is a bigger issue than I thought - fix is in the works

codycraven’s picture

StatusFileSize
new1.17 KB

Please test

codycraven’s picture

Status: Active » Needs review
stephesk8s’s picture

This worked perfectly for me. Thanks!

tboornaz’s picture

I 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.

codycraven’s picture

tboornaz,

Mmm I thought I addressed that issue, did you set a default country in the default settings for the CCK field?

bgilday’s picture

I 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.

DanielJohnston’s picture

Yup, same thing happening on my installation. Leaving country and province blank while editing field settings appears to be a no-no.

tboornaz’s picture

I had the country set to none. I set the country to normal and that prevented the error or warning. Thank you.

letapjar’s picture

The 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.

mikeytown2’s picture

Assigned: codycraven » Unassigned

Going 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

codycraven’s picture

Assigned: Unassigned » codycraven

shifthappens 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]

mikeytown2’s picture

Assigned: Unassigned » codycraven

Call 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.

codycraven’s picture

mikeytown2,

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.

graper’s picture

for 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.

wojtha’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that patch in #7 fixes the issue and suggesting RTBC status for this issue.

codycraven’s picture

Status: Reviewed & tested by the community » Needs work

Committed 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.

timos’s picture

Just to confirm i tested the patch #7 too and it seems work

scotwith1t’s picture

I 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.

AlexisWilke’s picture

#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

mikeytown2’s picture

StatusFileSize
new1.04 KB

Tested 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.

mikeytown2’s picture

Version: 6.x-1.08 » 6.x-1.x-dev
AlexisWilke’s picture

Assigned: codycraven » AlexisWilke
Status: Needs work » Fixed

mikeytown2,

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

Status: Fixed » Closed (fixed)

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