Closed (fixed)
Project:
TinyMCE
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2006 at 00:20 UTC
Updated:
21 Sep 2007 at 14:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
kiz_0987 commentedThis is more serious than I thought since this effect will occur for all time as soon as there is one revision in the database. Let's say I have a node with nid 100, vid 100 and I save a new revision. It will be nid 100, vid 101. The next time I save a node it will have nid = 101, vid = 102 (as 101 cannot be reused). So every PHP page that I write from then on will not be detected by TinyMCE and so when I edit them the PHP code is stripped.
Comment #2
m3avrck commentedI'm not sure I understand the problem. Is this to do with PHP visibility for when TinyMCE is to show, under the settings? Or in the node itself?
If it is the node itself, this would be a bug with Drupal core and not TinyMCE.
Comment #3
kiz_0987 commentedIt's a problem with TinyMCE, not with Drupal. The TinyMCE bar should not be visible when PHP filter type is used. If the bar is on by default and not turned off before the page is fully displayed then all the PHP code is stripped.
The problem is with the following code (in _tinymce_page_match()):
Say I'm editing node 45, this is doing a SELECT when nid = 45 AND vid=45. But it is likely in fact that nid = 45, vid = 47 (or something) if there have been any revisions (of other pages) beforehand. For example, say I had created revisions of node 44 twice before creating node 45, its nid/vid in the database will be 44/44, 44/45, 44/46. So when I added node 45 originally it's nid/vid will be 45/47 and so the PHP test fails.
Comment #4
m3avrck commentedkiz_0987 , great find! The logic for this was completely wrong. I rewrote all of it and simplified it greatly. Should be working perfectly now, please confirm, thanks!
Comment #5
kiz_0987 commentedWorks fine. Thanks very much for the quick fix.
Comment #6
jessZ commentedI also find that tinyMCE is eating my php code even when I have php content selected for input format and eating my html even when i have html selected.
It is intermittent in it's error when dealing with a flexinode. It will filter the HTML in the first text area, but not the second. Is this the same bug. Do i just need to downlooad the CVS version of the module?
Can i set up a node type that is not filtered but still allows use of the tinymce toolbar or must it be turned off to turn off filtering?
Comment #7
m3avrck commented@JessZ, you might want to try the CVS version, this fixed a big problem with TinyMCE eating up all PHP code.
You should be able to have a node type with an input format that isn't filtered and TinyMCE should work with that.
Comment #8
jessZ commentedI will dowload and install the cvs version. In the meantime i have gotten clearer on where I am having the most devere problems. The module works fairly well for story, book and page nodes where there is only onetext area where the tinyMCE interface is available. (the onlyobvioud bug being that the first time a php node is created the tynyMCE interface is on. It goes off the second time.)
Howver in nodes where there are multiple text areas, (such as flexinode and dashboard) some text areas are filtered correctly, that is in accord with the input format radio button but others are filtered very aggressively and ALL html is stripped.
Comment #9
(not verified) commentedComment #10
RobRoy commentedI'm still getting this on 4.7.x-1.x-dev. If this really is in HEAD, which I couldn't see that it was, it should really be backported to 4.7 as it's a pretty critical bug.
Comment #11
RobRoy commentedFound out that it was just happening for blocks. Added a check in there for the blocks admin page.
This also includes a resizable fix because I don't have time right now to split them up.
Comment #12
j4h8 commentedFor using the patch with 5.1, it has to read
This is because there is a "build" argument in the URL: "admin/build/block/configure/block".
After having added this argument and changed block_box_get(arg(4)) to block_box_get(arg(5)), the patch worked fine.
(Note that I did not test the resizing part of the patch.)
Comment #13
darren ohPlease continue the discussion in issue 106153.