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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Antoine Vigneau’s picture

Title: replace call failed with CKEditor » replace() call failed with CKEditor
Issue summary: View changes
Antoine Vigneau’s picture

Here 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.

gwolfman’s picture

I'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.

kenorb’s picture

Status: Active » Needs review
nategasser’s picture

#3 worked for me when using "Expand on Bullet."

Thanks!

piotrsmykaj’s picture

Merged #2 & #3 in one file.

vuil’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs reroll.

vuil’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.7 KB

Re-roll the patch of #6.

  • ilchovuchkov committed 97eb62a on 7.x-1.x
    Issue #2407031 by ilchovuchkov, piotrsmykaj, gwolfman, antoine-vigneau:...
vuil’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vuil’s picture