Opened 12 years ago

Closed 12 years ago

#9706 closed Bug (fixed)

Context Menu generates JS Error in inline mode when editor attached to Header element

Reported by: WebSpellChecker.net Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.0.1
Component: UI : Context Menu Version: 4.0
Keywords: Cc:

Description

The problem reproduces in inline mode when editor attached to element which does not wrap editable content into <p>. e.g. H1, H2, H3 tags.

Steps to reproduce:

  • open sample inlineall.html
  • initiate editor for the string "Lorem ipsum dolor sit amet dolor" - H3 element
  • select first word (Lorem) and make it bold
  • right-click on the first word (Lorem)

Expected result: Context Menu is displayed

Actual result: JavaScript error is shown in console: Uncaught TypeError: Object #<Object> has no method 'hasClass' /lib/ckeditor-dev/plugins/menu/plugin.js:346

Change History (10)

comment:1 Changed 12 years ago by Wiktor Walc

Milestone: CKEditor 4.0.1
Status: newconfirmed

comment:2 Changed 12 years ago by Garry Yao

Owner: set to Garry Yao
Status: confirmedreview

Opened review ef6bb9c

comment:3 Changed 12 years ago by Piotrek Koszuliński

Status: reviewreview_failed

I pushed rebased branch + docs correction git:cb011fd.

R- because:

  1. Open inlineall sample.
  2. Open context menu in editor on the right.
  3. There's no table, but context menu contains Delete table and Table properties options (on Chrome and FF at least).

comment:4 Changed 12 years ago by Piotrek Koszuliński

It's because https://github.com/cksource/ckeditor-dev/blob/t/9706/plugins/bidi/plugin.js#L121

Function has been removed, but invocation no. After this is corrected, there's no issue which I mentioned in comment:3.

What worries me is - why there's no error on the console? Why refresh() is executed in try-catch?

comment:5 Changed 12 years ago by Piotrek Koszuliński

Owner: changed from Garry Yao to Piotrek Koszuliński
Status: review_failedassigned

comment:6 Changed 12 years ago by Piotrek Koszuliński

Status: assignedreview
  1. I pushed git:358b472 (t/9706b) with simplified fix, without unrelated changes.
  2. I extracted unrelated changes to #9784.
  3. Reply for comment:4 - refresh() method is executed in silently failing try-catch because it's a listener for selectionChange which is a "bulletproof" event. This is another case in which we could miss some issue because of that, so we need to at least log these errors - #9786.

comment:7 Changed 12 years ago by Piotrek Koszuliński

  1. I pushed also one test - t/9706b@tests.

comment:8 Changed 12 years ago by Olek Nowodziński

Status: reviewreview_passed

comment:9 Changed 12 years ago by Olek Nowodziński

OT: Extracted #9795 while reviewing the ticket.

comment:10 Changed 12 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Masterised git:390e766.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy