Hello,
I have a JS issue with dhtml_menu.js on node edit form when I want to edit Arabic content. It prevents the load of the CKEditor on the page.
Uncaught TypeError: Cannot read property 'replace' of undefined - dhtml_menu.js?:65
The line error is:
var rtl = $('html').attr('dir') == 'rtl' ? Math.ceil($('.menu li').css('margin-right').replace('px', '')) + 1 : 0;
So it happens only on the arabic UI because on other languages I used, this condition $('html').attr('dir') == 'rtl' is false, the 0 is used and the replace() function is never called.
I can quickly create a patch to bypass this code or put a reliable value on the rtl var, but I was wondering if I could face real troubles if this is not well managed? As we verified if the dir of the page is rtl, it should have a good reason I guess?
Comment | File | Size | Author |
---|---|---|---|
#8 | 2407031-8.patch | 1.7 KB | vuil |
Comments
Comment #1
Antoine Vigneau CreditAttribution: Antoine Vigneau commentedComment #2
Antoine Vigneau CreditAttribution: Antoine Vigneau commentedHere is the quick patch I created, basically it checks the existence of the value we're trying to read, so it avoid to have an error. But the default value is then 0, and I don't know if it's ok for the well running of dhtml menus, will have a look in comming days.
Comment #3
gwolfman CreditAttribution: gwolfman commentedI've found a similar issue when the "Expand on Bullet" option is selected. I have submitted a patch that appears to fix the issue in a similar way.
Comment #4
kenorb CreditAttribution: kenorb commentedComment #5
nategasser CreditAttribution: nategasser commented#3 worked for me when using "Expand on Bullet."
Thanks!
Comment #6
piotrsmykaj CreditAttribution: piotrsmykaj commentedMerged #2 & #3 in one file.
Comment #7
vuilNeeds reroll.
Comment #8
vuilRe-roll the patch of #6.
Comment #10
vuilComment #12
vuil