When there are several widgets with the same vocabulary used with different CCK fields and new term is added, would be great to update all instances of HS with the same vocabulary so created term would be available in all instances without page reload.
Other way user either reloads node edit page (very bad usability) or he can use term creation several times ( even worse cause duplicate terms are created)

CommentFileSizeAuthor
#4 284724.patch1.16 KBwim leers

Comments

wim leers’s picture

Assigned: Unassigned » wim leers

Heh, very interesting problem. I of course never foresaw this. Will give this some thought.

wim leers’s picture

Priority: Normal » Minor

Ok, this would actually be pretty easy, since all key components are already in place!

1) Add a hierarchy identifier somewhere in Drupal.HierarchicalSelect.settings
2) Whenever a new item is created, check if there are other HSs with the same hierarchy identifier and do a $(selector).trigger('enforce-update'); on them.

That's it :)

wim leers’s picture

I just realized 1) is already supported: the cacheId. Now this becomes REALLY trivial :)

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

Please give this patch a try. :)

wim leers’s picture

Title: Force update on all widget instances with the same vocabulary when term is added » Force update on all Hierarchical Selects with the same hierarchy when an item is created
Status: Needs review » Fixed

I just tested a slightly improved patch (the above patch also updated the other widgets when the creation of a new item was cancelled), found it worked perfectly, and then committed it.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.