Hello,

Thank you for this great module which I'm sure will get a lot of attention since HS hasn't seen any updates for a little while now...

Chosen seems to conflict with the option "Allow creating new levels" in SHS as well as the "Required field" option.

The problem

the first term disappears once it has been selected leaving only the next term to choose from:
Nothing selected
Selected
Also if you choose "add a new item" for the first term and then click cancel the Chosen js is not used anymore and a simple select list is presented, the second term has disappeared as well.
New term
New term 2

I don't see any javascript error in the console.

Comments

stborchert’s picture

Status: Active » Needs review

Hm, I couldn't reproduce the first wrong behavior you've mentioned but committed a fix for the problem with the "cancel"-button.
You'll need to wait for the next development release (> 7.x-1.6+10-dev) to see this in action.

jibize’s picture

Sorry for my late reply....

Thank you very much for looking into this.

I don't see any of the behaviours mentioned above anymore, however It looks like there is a problem:

  • select the first term
  • for the child term choose "add new item"
  • add your term and click save

the term is actually saved at the same tree level as the parent, it is not saved as a child of the first selected term (you need to refresh the page or look at the taxonomy tree page to see this).

This only occurs when chosen is used for the widget.

Let me know i you think it is not related to the previous issue and/or you would prefer me to create a new issue for this.

jibize’s picture

StatusFileSize
new4.36 KB

I had a chance to take a better look at it and I found a few more problems that the attached patch hopefully fixes:

  • The chosen element wasn't used for newly created element, "simple" select list was used instead.
  • The setting "Allow creating new levels" wasn't respected when a new term was created: no new element was added after the newly created term.
  • When Chosen was used and a 2nd level term was created its parent wasn't set, putting the term at the root of the vocabulary.
  • When "save" was clicked with an empty input value Chosen wasn't used anymore.
  • The width of Chosen elements wasn't properly set, leaving the element with the width of the first term.
ssoulless’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

#3 works perfectly for me thanks for the patch, they would be great if they commit this patch.

kopeboy’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
StatusFileSize
new31.11 KB
new43.07 KB

Guys I'm having this issue on fresh install.
When this will be included in a stable release please?

Currently, on latest Drupal core and Chosen 7.x-2.0-beta4, the selects show as default, not Chosen style.
Only after I drag one selected item (so I have to add a new item first to be able to drag), the dragged element is shown with Chosen style.
Default select form
Chosen Select form

I created a separate issue

ssoulless’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

did you applied the patch? I think your issue is very separated of this one

sja1’s picture

Status: Reviewed & tested by the community » Needs work
sja1’s picture

This patch won't apply correctly to the latest dev version. I have manually applied the patch to the latest dev, and rolled another patch (attached - patch made from inside the modules/shs/js directory). However, the chosen integration is still buggy.

With the latest unpatched dev, I added a term-reference field to a content type, and attached a vocabulary with a 2 level hierarchy. I set it to force chosen always, and to force selection of the deepest level.

When creating a new instance of the content type, the field is displayed twice. Once without chosen, and just to the right, a chosen widget with nearly zero width. (See first and second screenshots attached.)

After manually applying the patch (then clearing caches and refreshing the browser), the width of the chosen element is fixed, but I'm still getting two widgets for the one field. (See third screenshot attached.)

sja1’s picture

Status: Needs work » Needs review
StatusFileSize
new3.88 KB

Rerolled patch against latest dev. The other problem I mention above (shs widget not being hidden but instead shown alongside the chosen widget), has a fix in this issue: https://www.drupal.org/node/2358437

stborchert’s picture

Status: Needs review » Closed (duplicate)

Closing this issue in favor of #2084019: Support Drupal Chosen 7.x-2.0-alpha3 using Chosen v1.0 to bundle the update to Chosen 1.x.