I have an schema as described here: http://drupal.org/node/810790. Basically, there is a table Properties, with node references for location, in this way: Properties > Area > City > State.

The thing is that I want to store the State, but just internally, but I need a view with a location hierarchical select filter, where I can select the city and the area, or just the city. But with my configuration I always have to select the State first, I need that City is the first level in the hierarchy select. I need a filter with only the two deepest levels.

On properties I have three values for location, and I´m saving the the whole lineage. Configuring the filter in Node reference path I select Areas.Cities -> Cities.States, if I only select Areas.Cities, the filter doesn't work properly.

Can anyone help me with this? I think this can be quite common.

Thanks in advanced!

CommentFileSizeAuthor
#7 cityaddress2.jpg23.04 KBjrao
#5 cityaddress.jpg21.49 KBjrao

Comments

taote’s picture

Nobody? I think this is feature is really needed

jrao’s picture

Sorry, I'm currently tied up in other project and won't be able to look into this until sometime next week.

taote’s picture

Ok, thank you. Please let me know as soon as you can, and if there is something I can do to help.

taote’s picture

Any progress? Thanks.

jrao’s picture

StatusFileSize
new21.49 KB

I tested this using the test setup in http://drupal.org/node/626088, basically I reused State/City/Address, and added a new content type Properties, which has a node reference to Address (reference path=Address.City-City.State, save lineage, number of values=3, content types=Address/City/State). I then added a view with filter Content:Address exposed (selection type=Hierarchical Select, node reference path=Address.City), it seems to work without problem (see attachment).

taote’s picture

Hi. Thank you for testing.

I have the same scenario, my content type is defined in the same way.

Also the view, but when in the view filter I select for the node reference path:

  1. Address.City
  2. And then there is a second select, with two options: empty and a City.State option.

If I choose the empty one, the first select in the filter contains State and City values, and I only want City values. Is this happening to you too? Is there anything else I could try?

Thanks again!

jrao’s picture

StatusFileSize
new23.04 KB

"And then there is a second select, with two options: empty and a City.State option.": This is correct, you should choose the empty one.

"If I choose the empty one, the first select in the filter contains State and City values": I'm not sure why this is happening, but it's not the case in my test instance, see attachment.

taote’s picture

jrao thanks again for your time. I revised everything. The behaviuor is very strange, because in the first select I get a mix of state and cities values, but when I select a value corresponding to a state, in the second select I get area values.

You can see an example here, under the label Localizacion, maybe this could help. I'm in a hurry because I need to finish this website, and I don't know how to make it work.

jrao’s picture

I see the problem, but I'm not certain why this is the case, can you give me admin access so that I can take a look inside? You can send it to my email via the Contact tab of my account.

jrao’s picture

I took a quick look around, one difference between our setup is your address content type has number of values =2 and references both city and state, in my case, it has number of values = 1 and only references city. Not sure if this is relevant yet, will do more testing on my end later.

taote’s picture

Yes, trhat's the key. I changed it temporarily to 1 value, referencing only cities and it was working fine (apart from a lot of warnings). But, in theory it should work with two values. I changed it back.

Well, I don't know why you need 3 values, because for a real entity relationship, in properties I should only need the address value.

Ok, at least now we have a clue.

Thank you for your help jrao.

jrao’s picture

Status: Active » Needs review

Finally got some time to debug this, it's a bug in the module, it will appear when root field is also using this module. I have checked in a fix.

jrao’s picture

Status: Needs review » Closed (fixed)