Opened 9 years ago

Closed 8 years ago

#1752 closed Bug (fixed)

E.tagName has no properties when using tablecommands plugin.

Reported by: keith.pitt Owned by: arczi
Priority: Normal Milestone: FCKeditor 2.6.4
Component: General Version: FCKeditor 2.4
Keywords: Confirmed Review+ Cc:

Description

You get an error when trying to make text bold in a table when you have the "tablecommands" plugin installed.

E.tagName has no properties

FCKEvents(undefined, undefined) ApplyStyle(Object Element=b _StyleDesc=Object IsCore=true GetType_$=1) FCKCoreStyleCommand() FCKToolbarButton() FCKToolbarButtonUI_OnClick(click clientX=0, clientY=0, Object Name=Bold Label=Bold Tooltip=Bold Style=0 State=0) CancelEvent(click clientX=0, clientY=0)

Attachments (3)

1752.patch (523 bytes) - added by arczi 8 years ago.
1752_2.patch (1.2 KB) - added by arczi 8 years ago.
1752_3.patch (1.1 KB) - added by arczi 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by arczi

comment:1 Changed 8 years ago by arczi

  • Keywords Confirmed Review? added
  • Version changed from FCKeditor 2.5.1 to FCKeditor 2.4

Steps to reproduce:

  1. In fckconfig.js add:
    	FCKConfig.Plugins.Add( 'tablecommands' );
    

add 'TableHorizontalSplitCell' to default toolbar

2.Paste in source mode:

<p>&nbsp;</p>
<table width="200" cellspacing="1" cellpadding="1" border="1">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>11111</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>

3.Back to WYSIWIG

4.Click 11111

5.Click Bold. In FF3 (Vista32) you get an error:

oCell.tagName is undefined
http://localhost/edytor/FCKeditor/tags/2.5.1/editor/_source/internals/fcktablehandler_gecko.js
Line 51
51 if ( oCell.tagName.Equals( 'TD', 'TH' ) )
52 aCells[aCells.length] = oCell ;

I attached a simple solution.

comment:2 Changed 8 years ago by fredck

  • Keywords Review- added; Review? removed

The proposed patch fixes the problem, but there a few things to keep attention:

  1. Ok, you are filtering now all ( nodeType == 3 ) nodes... but "if ( oCell.tagName..." is actually looking for ( nodeType == 1 ) stuff. What about potential nodeType that are not 3 or 1? So, instead of filtering the buggy part, the more correct and simple approach is simply going right to the point, by doing "if ( oCell.nodeType == 1 && oCell.tagName...".
  1. The patch should also contain the changelog entry for it.
  1. A small detail... the coding style should follow our standards.

Changed 8 years ago by arczi

comment:3 Changed 8 years ago by arczi

  • Keywords Review? added; Review- removed

comment:4 Changed 8 years ago by alfonsoml

  • Keywords Review- added; Review? removed

wouldn't it work to just use

oCell.nodeName.Equals( 'TD', 'TH' )

?

(I'm asking that question, just searching for a patch even better)

Changed 8 years ago by arczi

comment:5 Changed 8 years ago by arczi

  • Keywords Review? added; Review- removed
  • Owner set to arczi
  • Status changed from new to assigned

You're right, it is better solution.

comment:6 Changed 8 years ago by alfonsoml

  • Keywords Review+ added; Review? removed
  • Milestone set to FCKeditor 2.6.4

comment:7 Changed 8 years ago by arczi

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [2557]

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy