Opened 13 years ago
Closed 13 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 13 years ago by
| Milestone: | → CKEditor 4.0.1 | 
|---|---|
| Status: | new → confirmed | 
comment:2 Changed 13 years ago by
| Owner: | set to Garry Yao | 
|---|---|
| Status: | confirmed → review | 
comment:3 Changed 13 years ago by
| Status: | review → review_failed | 
|---|
I pushed rebased branch + docs correction git:cb011fd.
R- because:
- Open inlineall sample.
 - Open context menu in editor on the right.
 - There's no table, but context menu contains Delete table and Table properties options (on Chrome and FF at least).
 
comment:4 Changed 13 years ago by
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 13 years ago by
| Owner: | changed from Garry Yao to Piotrek Koszuliński | 
|---|---|
| Status: | review_failed → assigned | 
comment:6 Changed 13 years ago by
| Status: | assigned → review | 
|---|
- I pushed git:358b472 (t/9706b) with simplified fix, without unrelated changes.
 - I extracted unrelated changes to #9784.
 - Reply for comment:4 - 
refresh()method is executed in silently failing try-catch because it's a listener forselectionChangewhich 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:8 Changed 13 years ago by
| Status: | review → review_passed | 
|---|
comment:10 Changed 13 years ago by
| Resolution: | → fixed | 
|---|---|
| Status: | review_passed → closed | 
Masterised git:390e766.

Opened review ef6bb9c