Donate Share January 2009: Project of the Month

TinyMCE

Tracker: Bugs

5 Loosing 'id' attribute using 'forced_root_block' - ID: 2207710
Last Update: Comment added ( spocke )

User agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.3)
Gecko/2008092417 Firefox/3.0.3
Screen info: 1280x1024x32

Description of problem:

I use the 'id' attribute to keep track of some key information in a
document. The code that implements 'forced_root_block' (forceRoots) -
around line 11040, tiny_mce_src.js replaces the 'id' attribute of the first
top-level block with '__mce' without backing up/restoring any existing ID
(line 10162).

At the end of that function the id attribute is removed (line 10241).

I'm not aware of any prohibition against using the id attribute for my own
purposes - all that needs to happen is the old ID if present is backed up
and then restored.

This is only a problem if 'isIE' is false.

Steps to reproduce:
1. In the source document create an in-line element with an id attribute at
the top level.
2. Open the editor on that document.
3. Look at the page source - no id element.

I could fix this myself - but I'm not up to speed on the coding conventions
and so far haven't worked out how to build the 'compressed' JS file that
actually gets run.


Peter Wilson ( peterw8102 ) - 2008-10-29 16:35

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 2 )

Date: 2008-11-03 13:12
Sender: spockeProject Admin

This bug is corrected in the SVN version for the next release of
TinyMCE.

SVN might not be up to date, please wait 24-48 hours before
checking against the SVN to confirm it has been fixed.

Thank you for reporting this issue.

Regards,
TinyMCE Developers



Date: 2008-10-29 21:30
Sender: peterw8102

I now understand a little more about the core structure and realise
tiny_mce_src.js is simply a concatenation of all the various class files.
Needing a solution I attach my complete hack to the file that has the
problem : ForceBlock.js.

In my case I've tried the fix by directly patching tiny_mce.js - I can't
get JSTrim.exe to do anything other than complain so I can't rebuild
properly.

I've got round the problem by storing the applications 'id' value in the
'realid' attribute. For some reason multiple attempts to set that id to
__mce happen so it's protected against that. At the end, if there is a
'realid' attribute it's value is copied to 'id' and 'realid' is removed.

Tested in FireFox 3.
File Added: ForceBlocks.js


Attached File ( 1 )

Filename Description Download
ForceBlocks.js Updated version of Force Download

Changes ( 4 )

Field Old Value Date By
status_id Open 2008-11-03 13:12 spocke
resolution_id None 2008-11-03 13:12 spocke
close_date - 2008-11-03 13:12 spocke
File Added 299460: ForceBlocks.js 2008-10-29 21:30 peterw8102