Closed (fixed)
Project:
Address field for CCK
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
25 Jun 2007 at 16:15 UTC
Updated:
9 Jul 2007 at 19:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
rconstantine commentedHmm, first, I see that this issue is opened for version 1.0, which is not the latest version. You'll notice on the project page that the very first words in the description are USE THE DEV VERSION. So double check and make sure this isn't fixed in that version, or modify the version of this issue if that's what you've got.
Second, what you describe should only be happening at all if you REQUIRED that users fill in an address. I have several content types created without the address being required that do not break as you've described. Please confirm whether you have checked the REQUIRED box during content type creation.
Third, if you did REQUIRE the field, then a user should be filling in an address and since ALABAMA is the default, it would naturally be selected if the user didn't change it. If empty zips ARE being stored as 0 in the dev version, then I'll have to find out why. I'd rather not store it that way in the first place than unset the variable as you did in your patch.
So please confirm EACH of my questions above so I can proceed.
Thank you.
Comment #2
mjwest10 commentedSorry about that - you are right I was using the wrong version. I uninstalled it and installed the latest one. That fixed the zip being stored as 0 problem - it is now being stored as an empty string so thats good. However, it is still selecting Alabama as the default state - and I've double checked and I haven't checked the required option for the field. I even tried creating a new field and making sure the required box was not checked. I will now look at the code and see if I can figure anything out. Hope this helps and again sorry I didn't notice that I should use the DEV version.
Comment #3
mjwest10 commentedI checked the code and I couldn't find where you were handling if the user didn't check the required field. I also thought of one more thing - I am selecting that states should be displayed with Select with Fullname. At anyrate, one solution is to change the cck_address_get_states function to add a blank option if the user did not say the field is required. I submitted a patch for this. If I am totally missing something again I am sorry - please know I am trying to be helpful and not just complain, but I am just learning PHP so sorry if I miss something. Thank you for a great module that is very helpful to me.
Comment #4
rconstantine commentedNo need to apologize for anything. If you take the time to read past issues for this module (as well as my other modules), I think you'll find that I welcome any relevant issue that will make my module better. I am working on an overall project that requires all modules work as expected. So I have released my modules in the hopes that by the time I need to go live, all bugs will be worked out.
I'll review your patch and latest observations and see what can be done.
Comment #5
rconstantine commentedOkay, I fixed this such that upon submission, the street1, city, and zip fields are checked to see if ALL are empty. If so, then all other fields are made empty and saved that way. Then, if all fields are empty when you view the node, the address field simply isn't shown.
Comment #6
rconstantine commented