If bundle.js is loaded after drupal.js I get the following error on all pages with select forms:
Uncaught TypeError: Cannot set property 'innerHTML' of null
This also means that the Simple Hierarchial Select module stops working.
A temporary hack that sort of fixes it is adding {weight: -19} to the js load in permissions_by_term.libraries.yml, although that causes the error:
Uncaught ReferenceError: Drupal is not defined
I have experienced this error with certain bootstrap themes and the core Bartik theme.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3131293-claro-support-2.x.patch | 261.58 KB | heikkiy |
| #9 | 3131293-claro-support-2.patch | 262.72 KB | heikkiy |
| #6 | 3131293-claro-support.patch | 1.09 KB | heikkiy |
Comments
Comment #2
robotjox commentedComment #3
robotjox commentedNever mind. This turns out to be a problem with certain Bootstrap-based themes and their templates. Bartik is not affected by this as I reported earlier.
In case this helps others: what solved the problem for me was including a form-element.html.twig file in my theme's template folder.
I suspect a missing div was the culprit.
Comment #4
intrafusionI am getting the exact same issue using Claro, I'm investigating a solution
The Chrome console reports:
Comment #5
heikkiy commentedThis is most likely due to Claro changing the default classes for form-element:
Seven:
<div class="js-form-item form-item js-form-type-select form-type-select js-form-item-field-targeting form-item-field-tags">Claro:
<div class="js-form-item form-item js-form-type-select form-type--select js-form-item-field-targeting form-item--field-tags">Both form-type--select and form-item--field-tags have changed in Claro.
Comment #6
heikkiy commentedProblem seems to actually be with the following code in dom-client.protype.js which is trying to find a field with the class .form-type-item. This has changed in Claro to be .form-type--item. It would be better to use the JS class .js-form-type-item which is the same in Seven and Claro.
Attached is a patch for this.
Comment #7
heikkiy commentedComment #8
heikkiy commentedThere seem to be also automated tests which are covering this part but they seem to always finish successfully not taking Claro DOM into account.
Comment #9
heikkiy commentedThis also updates the included Webpack bundle.
Comment #10
heikkiy commentedThe above patch was run against 3.x. Here is a similar patch for 2.x.
Comment #11
jepster_Thanks for the patches! I have applied them on the latest patch releases.
3.1.4: https://www.drupal.org/project/permissions_by_term/releases/3.1.4
8.x-2.27: https://www.drupal.org/project/permissions_by_term/releases/8.x-2.27
Comment #12
jepster_