- Issue created by @gr4phic3r
- π¨π¦Canada joseph.olstad
Please try the latest release
https://www.drupal.org/project/shs/releases/3.0.0-beta2 β - π¦πΉAustria gr4phic3r
Still 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:2Not sure if the module security kit, which i use, has some effect to this
- π¨π¦Canada joseph.olstad
probably related to the module security kit
With that said, feel free to upload a patch if you figure this out.
- π¦πΉAustria gr4phic3r
thanks 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 ;)
- π¨π¦Canada joseph.olstad
You'll want to replace that jquery.min.js with jquery.js
minified is difficult to work with
- π¦πΉAustria gr4phic3r
in 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 :) - π¨π¦Canada joseph.olstad
try uninstalling the "module security kit" , undo your changes, rebuild caches and then see what happens.
- π¨π¦Canada joseph.olstad
Is this the module you're using? https://www.drupal.org/project/seckit β ?
- π¦πΉAustria gr4phic3r
sorry, forgot to mention the file, it's shs/js/views/WidgetView.js
yes, using https://www.drupal.org/project/seckit β
- π¦πΉAustria gr4phic3r
I 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 disappears. 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 - π¨π¦Canada joseph.olstad
Thanks, someone can take that and make a patch with it, this is for 3.0.x right?
- π¨π¦Canada joseph.olstad
@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.
- π¦πΉAustria gr4phic3r
@joseph.olstad
yes, I used the latest code and thanks for the link, will look into how to make a patch