It would be nice if this module was ported to Drupal 8.I know its too early to ask for this but its good this issue to exist.
Also it would be nice if there was a selection to disable the javascript effects of the HS.
Cheers,
Sokratis

CommentFileSizeAuthor
#1 Screen Shot 2015-03-19 at 13.42.16.png21.35 KBmarthinal

Comments

marthinal’s picture

Status: Active » Needs review
Related issues: +#2455617: Ajax does not work for custom form elements.
StatusFileSize
new21.35 KB

Hi guys,

I was working a little bit on it.

Here is the repo https://github.com/marthinal/hsd8

Needs improvements and refactor, a lot of work. :)

For the moment, we can select the widget and it works but not perfectly :)

Screenshot attached.

We need to apply this patch https://www.drupal.org/node/2455617

Cheers

wim leers’s picture

To be honest, I think Hierarchical Select should be rewritten in Drupal 8.

Hierarchical Select was developed for Drupal 5, then ported to 6, and (mostly) ported to 7. During the majority of those years, graceful degradation (i.e. still working when JS is not enabled) was a must. Now, it's no longer a must, it's rather silly.

This module could be an order of magnitude simpler to maintain if it were doing the majority of its work in JS, and if it'd just rely on API endpoints to talk to the server.

That being said, if you want to port this to Drupal 8, you're of course more than welcome to. But given how difficult it is to maintain this module, given how many Drupal custom & contrib modules override forms in stupid, broken, bad ways, following the same fundamental architecture is going to be full of frustration.

marthinal’s picture

I agree with you about rewrite the module. I was learning how exactly it works while porting and yes probably makes no sense to port the same code.

If I have time I would like to think about the best way to do this functionality. :)

Anyway the repo is available if anyone wants to continue porting.

Thanks!!

wim leers’s picture

I'd say we'd want to use https://select2.github.io/examples.html, and tie multiple of those Select2 instances together dynamically. That'd even make it portable (not specific to Drupal). Couple that with a hierarchy iterator API, and we're 90% of the way there, with 2000% less maintenance hassle :)

user654’s picture

.

marthinal’s picture

@Wim Leers that's exactly what I was reviewing this morning. :)

This issue is interesting #2346973: Improve usability, accessibility, and scalability of long select lists

Sounds great! :)

I need to investigate a little bit more. So I hope to have time during this weekend.

stefan.r’s picture

And maybe that rewrite could be backported into a D7 Hierarchical Select 4 (without graceful javascript degradation)? :)

marthinal’s picture

I was working a little bit on it and based on the concept of shs module I made some progress.

https://github.com/marthinal/hselect2

stefan.r’s picture

Great! Since no-one is working on a D8 version of Hierarchical Select and @Wim Leers favors a rewrite similar to this, if you're interested we can post it as the 8.x version of this project so it has better visibility (once it's ready)?

Let me & @Wim Leers know when you consider this ready for review so we can commit once it's RTBC.

marthinal’s picture

Sure!

I've created this sandbox https://www.drupal.org/sandbox/marthinal/2469075 but we can use the code for the new HS version.

walkero’s picture

How is the development of this module going? Will we see final version in the future? Will it be able to upgrade from D7 hierarchical_select?

nwom’s picture

I'm looking forward to this! I'm about to start a new project in Drupal 8, and this is one of the only necessary modules that hasn't been ported yet. I'm rooting for you guys!

kriboogh’s picture

Any progress on this? We need this type of functionality in our ongoing project, we als need to be able to add new levels in the hierarchy, is this lined-up too?

marthinal’s picture

@kriboogh AFAIK SHS module is under development for D8. You should take a look there.

hugronaphor’s picture

summit’s picture

Hi, https://www.drupal.org/project/shs has not the functionality to use term lineage.
The great thing from HS in my perspective was easily to add a deeper term to a node, and then the whole lineage would be integrated.
So a node about a place within a city would be shown within the country, province and city term view.

What module is for Drupal 8 now suggested to be able to build and edit nodes easily with this same functionality of adding the term lineage with a nice UI?

Thanks for your reply in advance,
greetings, Martijn

summit’s picture

Please, please, I really need the HS functionality on Drupal 8.
How else can I add Country, Province, Place to a specific Node?

greetings, Martijn