Needs review
Project:
Simple hierarchical select
Version:
3.0.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2025 at 22:09 UTC
Updated:
13 Nov 2025 at 20:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joseph.olstadPlease try the latest release
https://www.drupal.org/project/shs/releases/3.0.0-beta2
Comment #3
mp commentedStill doesn´t work, when i press the button "Add new" i get an error message at console:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
1 source
jquery.min.js:2
Not sure if the module security kit, which i use, has some effect to this
Comment #4
joseph.olstadMight be related to Drupal 11.1.1 which uses jQuery 4
probably related to the module security kitWith that said, feel free to upload a patch if you figure this out.
Comment #5
mp commentedthanks for the info
I´m a frontend dev, not able to write a patch, but will try to get it to run with AI help, maybe I´m lucky ;)
Comment #6
joseph.olstadYou'll want to replace that jquery.min.js with jquery.js
minified is difficult to work with
Comment #7
mp commentedin Line 213 instead of "async: false," write "async: true,"
This brings me a step further but it is only possible to add new terms when there are already terms on this level. Does a Level1 term have no Level2 terms then the input-field and the "Add new" button doesn´t appear. Only if there are already Level2 terms (manually added before). ChatGPT and Claude were not able to fix that :)
Comment #8
joseph.olstadline 213 of what?
Comment #9
joseph.olstadtry uninstalling the "module security kit" , undo your changes, rebuild caches and then see what happens.
Comment #10
joseph.olstadIs this the module you're using? https://www.drupal.org/project/seckit ?
Comment #11
mp commentedsorry, forgot to mention the file, it's shs/js/views/WidgetView.js
yes, using https://www.drupal.org/project/seckit
removed Security Kit and cleared all caches via browser and drupal - no effekt
Comment #12
mp commentedI managed to fix the error with AI and added a new feature.
About the new feature, it is a new setting in the widget settings that you can set a maximum hierarchy level, for example 3 levels. Example animals - Genus, Species, Subspecies, there can be only 2 levels (Genus + Species) or also 3 levels (Genus + Species + Subspecies). If there are 3 levels and someone chooses on the last allowed level a term then the input field and "Add new" button disappear. Is there still the default "- Select a value" in the dropdown then you can add more terms on this level.
I tested it and it worked for me, but more test runs would be helpful to verify.
btw, i have no clue how to make a patch, i added the files as zip files
/shs/js/views/WidgetView.js
/shs/src/Plugin/Field/FieldWidget/OptionsShsWidget.php
Comment #13
joseph.olstadThanks, someone can take that and make a patch with it, this is for 3.0.x latest version right? I'm hoping you used the latest code before making the patch, if not, will sort it out.
Comment #14
joseph.olstadComment #15
joseph.olstadHow to make a patch
@mp, for this time, it's great, thanks for your upload, for next time, you may be interested in learning how to write a patch. I've included the link to the documentation on this. There's even a video giving a demo.
Comment #16
mp commented@joseph.olstad
yes, I used the latest code and thanks for the link, will look into how to make a patch
Comment #17
mp commentedhi, status is "Postponed (maintainer needs more info)" - which informations do you need? how can i help?
Comment #18
rozzi commentedI see no create new item button despite my role having a Create terms permission and every other taxonomy-related permission. Allow creating new items is enabled for the field form. There is only one hierarchy level in that particular vocabulary composed of 13 pages of items. Using 3.0.0-beta4 on the latest Drupal 11.
Comment #19
mp commented@rozzi I think my patch is not included in 3.0.0-beta4 and @joseph.olstad gave me no feedback yet if he needs more informations.
You can try beta3 and use my modifications - works very well :)
Comment #20
joseph.olstad@mp, still waiting for your patch, that's what is holding this up. Please see comment #15, I left instructions on how to generate a patch. I haven't had time to discern what your zip file is about. A patch or merge request is required.
Comment #21
mp commented@joseph.olstad sorry, that was a misunderstanding, thought someone else will do it :) ... I added 2 patches for beta3 and beta4, both are not tested yet
Comment #22
joseph.olstadComment #26
joseph.olstadHere's the patch file from MR 44.
Comment #27
joseph.olstadNeed to fully understand the changes and evaluate what changes and or automated testing changes may need to be done.
@mp , the automated tests no longer jive with these changes. It will take some time to evaluate this.
Comment #28
joseph.olstadComment #29
joseph.olstadHmm, ok test failures could be caused by 11.2.x
running new tests.
Comment #30
joseph.olstadok , test failures are due to the code changes. It's likely the automated tests need to be re-aligned for the updated functionality.
With that said, someone needs to review the patch file from MR 44 and explain the changes, review the changes and confirm that this is correct.