Clientside hierarchical select
A simple client-side hierarchical select widget for taxonomy terms.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/valderama/2287697.git cshs
cd cshs
Similar projects
Looks similar to SHS (Simple Hierarchical Select) and Hierarchical select, but in contrast to those modules the whole taxonomy tree is already present at page-load and the whole processing is done "client-side".
The implementation is simpler as most of the work is done by a custom jQuery Plugin which transforms the select-input with the option tree into multiple selects (one for each level in the hierarchy).
Why another module?
The different architecture (clientside vs. reload each sub-tree with an additional server-request) justifies the release as a separate module. A pure client side architecture has its limitations (in particular it would not work that nice for 10.000 terms in one vocabulary), but at the same time needing multiple requests for a small hierarchy is not nice either.
Screenshots
Review bonus reviews
I am currently reviewing those projects:
- https://drupal.org/node/2222795#comment-8892563 - manual review, including patch
- https://drupal.org/node/2223569 - in progress
- https://drupal.org/node/2288335#comment-8892891 - manual review including patch
- https://drupal.org/node/2273733#comment-8893037 - manual review including patch
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | pareview_results.txt | 1.67 KB | mpdonadio |
| #4 | 2288389-minor-cleanups-4.diff | 659 bytes | leewillis77 |
| CSHS_widget_settings.png | 89.5 KB | valderama | |
| CSHS_widget.png | 112.41 KB | valderama |


Comments
Comment #1
valderama commentedComment #2
valderama commentedComment #3
valderama commentedComment #4
leewillis77 commentedHi,
I took a look at the module. PAreview is nice and clean, but I did find a few minor things to tidy up (Fixing some grammar in the documentation, and removing unneeded stuff in the CSS files - patch attached).
There was one issue I found when I tried the module on my test site. Here's what I found:
Drupal reloaded the form (As expected), and flagged an error that "Title field is required.". It did *not* flag an error for the cshs field, and in fact, it reset all selections in that field, e.g. I only had one box, and it was set to "-Please choose-". It should have flagged an error for the cshs field, and maintained the levels that had been selected [What it does if you don't do the 4th step in the list above].
Comment #5
valderama commentedComment #6
valderama commentedHi! Thanks for your review.
I fixed field validation and also corrected the grammar on in the README.
Comment #7
valderama commentedComment #8
leewillis77 commentedHi,
I pulled down the latest version and there is still an issue with validation. Compare these two scenarios with the same setup as before:
Scenario 1:
Scenario 2
Comment #9
valderama commentedThanks again for your detailed testing.
After the weekend I now had time to take look at this bug. It is fixed and now the correct linage is remembered, even after setting one select to "- Please choose -".
Bugfix is in this commit:
http://cgit.drupalcode.org/sandbox-valderama-2287697/commit/?id=f4a9f98
Comment #10
leewillis77 commentedHi - that looks great - I can confirm it works as expected for me - updated to RTBC :)
Comment #11
mpdonadioI started my review of this, so I am assigning to me.
Comment #12
mpdonadioMy work/home commitments the last few days have prevented me from completing my full review, but...
The README does not follow the guidelines for in-project documentation and/or the README.txt Template. It really needs to describe how a user would use this module.
Did you contact the maintainers of either of the two modules that you mention above? As this is essentially just a field widget, it seems like it could be a pretty clean/easy patch to shs. This would consolidate some functionality, and give end users the ability to choose which best fits their needs and also change between them w/o needing new modules.
Comment #13
valderama commentedThanks for your short review!
As you suggested I have updated the README to contain more information.
Also, I have contacted stBorchert (https://www.drupal.org/user/36942) - the maintainer of SHS (Simple hierarchical select) and asked him about his opinion on a possible integration into the SHS module.
So, I'll leave this issue on "maintainer needs more info" - until we hopefully get input from stBorchert.
Greets,
Walter
Comment #14
valderama commentedComment #15
stborchertHm, its quite difficult for me to decide whether "cshs" could be integrated into "shs". While the resulting widget looks similar, the main concept is sure another.
I would suggest leaving this as a separate project for now and we could talk about a possible integration (and if its possible at all) during the next camp (maybe DrupalCamping ... ;) ).
Comment #16
valderama commentedThanks for your comment. I won't attend Drupal Camping unfortunately, but I am sure there will be an occasion to meet sooner or later.
I'll put this on "Needs review" again.
Comment #17
mpdonadioAutomated Review
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
False positives w/ the CSS and JS.
Manual Review
The JS doesn't use 2 spaces per level of indentation, which is the Drupal standard.
The module passed some explicit XSS tests.
The use of $key on line 252 troubled me, but this mirrors the usage in form_select_options(). I don't know why form_select_options doesn't use
drupal_attributes, but you may want to think about it here.
The !name placeholder in cshs_widget_validate also troubled me, but I tested this fairly extensively with XSS. I actually don't think the logic
here is correct, as I can't get $value to be '_none'. It also looks like this is escaped already, as I tested bypassing the test and passing
the t() to drupal_set_messasge.
I went through this a few times and didn't see any blocking issues. Seeting to RTBC and assining to @heddn for a second look if he has time.
Comment #18
valderama commentedThanks again.
I will update the JS code to use 2 spaces as indentation and take a look at you further comments asap.
Comment #19
valderama commentedCommitted a fix to comply with JS coding standards.
The value '_none' is the standard value for the empty option in selects. If we receive this value, I unset it to avoid further processing. In options.module the _none value is also unset (line 317).
Comment #20
heddnNot blockers:
Location file [cshs] - .../js/libs/jquery.simpler-select.js Problem synopsis Variable $select implicitly declared at line 120
Location file [cshs] - .../js/libs/jquery.simpler-select.js Problem synopsis Variable $option implicitly declared at line 143
Location file [cshs] - .../js/libs/jquery.simpler-select.js Problem synopsis Parameter parent is not described in JSDoc (at line 130)
See as there are no blockers... Thanks for your contribution, valderama!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.