I'm trying to use hierarchical select with term references, but I can't seem to enable the widget.

I have three content types with a hierarchy:
- Continent
- Country
- City

Everything looks ok at first. When creating a new entity reference field in Country that points to Continent, it is indeed possible to choose Hierarchical Select.
so far so good?

But in the next screen, it isn't. It's gone.
missing widget




Am I missing something?

Things I've tried:
- I've tried this in both an existing and a brand-new Drupal 7 installation.
- I've tried also adding a normal taxonomy term to "lure out" the widget :-)
- I've tried using an older version (the last alpha)

Comments

groovedork’s picture

Issue summary: View changes
groovedork’s picture

Issue summary: View changes
groovedork’s picture

Issue summary: View changes
stefan.r’s picture

Entity Reference support was only recently introduced and is very rudimentary, have you tried setting the field type to "term reference"? (as opposed to "entity reference")

fbreckx’s picture

Same problem here. Trying to select node via HSER (which is included according to https://www.drupal.org/node/2444865#comment-9709255), but I'm only seeing a flat list ...

stefan.r’s picture

Feel free to submit a patch for entity referenced support as the current functionality is still rudimentary...

bkat’s picture

This isn't generic but I wrote custom code to use hierarchical_select for selecting an entity_reference. In my case, I want to select a team but first select the club that the team belongs to. I do something similar for selecting users.

Anyways, here's my code to help anyone get started.

stefan.r’s picture

Status: Active » Needs work
pixelsweatshop’s picture

Status: Needs work » Needs review

There is a patch for review in #7

bkat’s picture

As the author of #7, it is in no way a patch. Its example code I wrote for my particular use case that allows me to use hierarcical_select with entity references.

stefan.r’s picture

Status: Needs review » Needs work

Back to NW

fmb’s picture

StatusFileSize
new5.74 KB

Thank you so much for sharing bkat. Here is an example with one level more.