Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After installing Beta 4 I am finding that many node edit forms are broken, with the Yoast dialogue appearing above instead of below the form. In addition, CKEditor is also broken and does not load.
Console reports the following error;
Uncaught TypeError: Cannot read property 'addEventListener' of null
js_CA96T1_m2RdVe313r273VuPXqBkzRPBo_Zt_IKzrOFY.js:1398
The error message seems to point at line 1398 of the js file file
document.getElementById(source).addEventListener("blur", listener)
Comment | File | Size | Author |
---|---|---|---|
#12 | yoast_seo-n2773385-12.patch | 546 bytes | DamienMcKenna |
Comments
Comment #2
robertragas CreditAttribution: robertragas commentedHello Paul,
Can I ask which version of the metatag module u have and could you try updating it?
Not sure if it would be the problem to your issues but I know many problems arise when the module version is too low.
Comment #3
MrPaulDriver CreditAttribution: MrPaulDriver commentedHi Robert, metatag was one version behind but after updating and clearing caches the problem remains
Comment #4
gstout CreditAttribution: gstout commentedconfirming identical behavior for us
Comment #5
gstout CreditAttribution: gstout commentedConfirming I am an ass. :)
This is a caching error on our end. Worked in dev but our cdns where sitting on old js files making it not work on our live setup which has CDNs
That said this function in yoast_seo.js did cause a fatal error and break CKEditor until I add the null check.
Hope this helps you @MrPaulDriver
Comment #6
gstout CreditAttribution: gstout commentedComment #7
DamienMcKennaThe JS problem should have been fixed by #2784549: Views Improvements.
Comment #8
vensires CreditAttribution: vensires commentedThe JS problem is still present in both 7.x-1.0 and 7.x-1.x-dev. The quickfix proposed in #5 fixes the problem. Is it a correct solution though or should the caller function check the
source
exists before calling parseSnippetData?Comment #9
lodey CreditAttribution: lodey as a volunteer and at NDP commentedI can confirm we were still getting the JS issue, causing CKeditor to not show. This was even with the latest or dev version.
The patch mentioned in #5 worked in fixing it.
Attached is a patch file, just implementing the basic change suggested in #5.
Comment #10
DamienMcKennaTidied up the code a little bit, can you verify the change to the if() statement still works?
Comment #11
lodey CreditAttribution: lodey as a volunteer and at NDP commentedUnfortunately that doesn't work for me.
typeof document.getElementById(source) is returning 'object' in my case.
document.getElementById(source) is returning 'null'
This works:
if (document.getElementById(source) != null) {}
Comment #12
DamienMcKennaSo more like this?
Comment #13
lodey CreditAttribution: lodey as a volunteer and at NDP commentedYep that works fine for me :)
Comment #15
robertragas CreditAttribution: robertragas commentedLooks good, committed. Thanks!