Project

General

Profile

Actions

Bug #21703

closed

After editing a link title or target with Firefox > 3 which have a custom CSS-Class the link gets lost after "update"

Added by mickthebig almost 15 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-11-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It's no problem to create a link with a custom css class with Firefox 3 and it gets rendered perfectly.

But after editing such a link's title or target with the RTE (Firefox > 3) the link gets totally lost after pressing "update". Links without having this CSS-Class adressed to, can be edited perfectly.

RTE.classesAnchor >

RTE.classesAnchor {
pfeil {
class = arrow
type = page
image >
titleText >
}
}

RTE.default {
useCSS = 1
contentCSS = fileadmin/templates/css/rte.css
classesAnchor = arrow
}

RTE.default.proc.allowedClasses = arrow
(issue imported from #M12782)


Files

beforeEditing.png (370 KB) beforeEditing.png Administrator Admin, 2009-11-27 21:21
whileEditingTheTitle.png (370 KB) whileEditingTheTitle.png Administrator Admin, 2009-11-27 21:21
afterPressingUpdateInPopup.png (314 KB) afterPressingUpdateInPopup.png Administrator Admin, 2009-11-27 21:21
rtehtmlarea_bugfix_12782_typo3_4-3.patch (1.04 KB) rtehtmlarea_bugfix_12782_typo3_4-3.patch Administrator Admin, 2009-12-11 16:28
rtehtmlarea_bugfix_12782_typo3_4-2.patch (1.04 KB) rtehtmlarea_bugfix_12782_typo3_4-2.patch Administrator Admin, 2009-12-11 16:32
rtehtmlarea_bugfix_12782_trunk.patch (1.04 KB) rtehtmlarea_bugfix_12782_trunk.patch Administrator Admin, 2009-12-12 03:41
Actions #1

Updated by Stanislas Rolland almost 15 years ago

What version of TYPO3?

Actions #2

Updated by mickthebig almost 15 years ago

Currently running TYPO3 4.2.8 (I know, shame on us)

Actions #3

Updated by Stanislas Rolland almost 15 years ago

Is there an error on the JavaScript console when this happens?

What do you mean by "the link gets totally lost"? What do you get in the RTE?

Actions #4

Updated by mickthebig almost 15 years ago

By the way, on my development system I'm running Typo3 4.2.10 and I've expierenced the same issue.

"Is there an error on the JavaScript console when this happens?"
-> No, unfortunatly there is no error displayed. I think there is something passed wrong to parent window and to the RTE

"What do you mean by "the link gets totally lost"? What do you get in the RTE?"
-> The edited link is no link any more

I uploaded some screenshot to show you better what happens. Sorry for the black marks...

Actions #5

Updated by Stanislas Rolland almost 15 years ago

Please provide a screenshot of the link dialogue. I am unable to reproduce this issue.

Actions #6

Updated by mickthebig almost 15 years ago

Yeah, sorry we needed to delete the screenshots, because our client was named. I uploaded the screenshots again and blacked out all names.

Do you mean, you've created a custom css style for links and you're not experiencing this problem? I neighther have the issue when I'm editing a link without a custom css style. Our client told us that he is not always having this issue when he is editing a link with a custom css style... So the reproducibility is not always...

Our htmlarea version is 1.7.11

Thank you for your help

Actions #7

Updated by Stanislas Rolland almost 15 years ago

Using the Page TSConfig you are providing, I can't reproduce this issue.

If reproducibility is not always, perhaps there is another condition...

Actions #8

Updated by mickthebig almost 15 years ago

Yeah maybe. I keep an eye on it. Funny is that only Firefox has this problem

Actions #9

Updated by mickthebig almost 15 years ago

Dear Stanislas,

there might be a problem in /typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js? I'm not sure yet because I haven't finished debugging.

I think the link gets removed like you described (line 161):
"// In FF, if the url is the same except for upper/lower case of a file name, the link is not updated.
// Therefore, we remove the link before creating a new one."

but no new link is build? As I say I'm not sure yet. I have problems debugging it because changes in this file don't take effect because they get delivered as compressed file. I keep on debugging and I'm gonna figure out how changes in this file take effect. For sure just for debugging :-)

Actions #10

Updated by Stanislas Rolland almost 15 years ago

After changing a file, use the Clear RTE Cache option of the TYPO3 Clear Cache menu (available to admin user or users with option set in user config), and clear the browser cache.

Actions #11

Updated by mickthebig almost 15 years ago

For me it's working fine, when I comment out line 164:
//this.editor._doc.execCommand("UnLink", false, null);

Now it's working in FF > 3. I haven't seen any site effects yet but you probably had a reason why you put the UnLink command there!? I can't see that links are not updated, without unlinking them.

But the question is why the link is not re created after unlinking?

Anyway I found a solution which is working for me.

Actions #12

Updated by Stanislas Rolland almost 15 years ago

If the link is a link to a file and if you change part of the name of the file from upper case to lower case or vice versa, the link is not updated if it is not first unlinked. See issue #8996.

Actions #13

Updated by mickthebig almost 15 years ago

Ok, then I have a look why It's not re created.

Actions #14

Updated by Michael almost 15 years ago

Had to create a new typo3 account...

this.editor._doc.execCommand("CreateLink", false, encodeURI(theLink)); is just not working. The Link is there and "this.editor._doc" is a object. What I recognised is, the the link somehow doesn't gets marked/selected after it was unlinked. Links where it is working editing the title which don't have a costum style, they get marked/selected (in the editor) after unlinking the link and before recreating the link. This might be the problem. So the createLink command doesn't know where to create the new link....

You could ask if the link has class and if it's not a link to file you don't need to remove the link. Then it's all working.

Actions #15

Updated by Stanislas Rolland almost 15 years ago

I wish I could reproduce this issue...

What is your css declaration for class arrow?

Actions #16

Updated by Michael almost 15 years ago

The CSS-Style is

a.arrow {
color:#ec1c24;
font-size:11px;
font-weight:bold;
background-image:url('../img/icons/more.gif');
background-repeat:no-repeat;
background-position:100% 50%;
padding: 0 14px 0 0;
}

I thought this issue is caused by the background image or any other style so I commented out for example the background image but it didn't change anything. So the link wasn't set neighter again.

The difference between a usual link (editing working) and a custom css link (editing not working) is what I mentioned before: "What I recognised is, the the link somehow doesn't gets marked or selected after it was unlinked. Links where it is working editing the title which don't have a costum style, they get marked/selected (in the editor) after unlinking the link and before recreating the link."

Maybe there is second fact important which I haven't checked yet. Maybe the link which can not be edited was edited before in the Internet Explorer. Maybe this makes it impossible for the Firefox to edit the link afterwards but this is so far just a guess. I have to check on this.

Actions #17

Updated by Stanislas Rolland almost 15 years ago

Using this style declaration, I am still unable to reproduce the problem.

What Firefox add-ons do you have installed?

Actions #18

Updated by Michael almost 15 years ago

I don't think this is the problem. I've experienced this problem with different firefoxes 3.0.4. and 3.5. under Windows XP and Mac Os X.

If I find a silent minute I try analysing the problem a little bit more.

Actions #19

Updated by Michael almost 15 years ago

alert(selection);
this.editor._doc.execCommand("UnLink", false, null);
alert(selection);

The first output is the link alias.
The second output is emtpy.

I think it's not supposed to do this. Can't we set the selection again?

I found this:
// fix up unlink in Mozilla to unlink the link and not just the selection
+ } else if (command == "unlink" &&
+ this.queryCommandEnabled("unlink") && dojo.render.html.mozilla) {
+ // grab selection
+ // Mozilla gets upset if we just store the range so we have to
+ // get the basic properties and recreate to save the selection
+ var selection = this.window.getSelection();
+ var selectionRange = selection.getRangeAt(0);
+ var selectionStartContainer = selectionRange.startContainer;
+ var selectionStartOffset = selectionRange.startOffset;
+ var selectionEndContainer = selectionRange.endContainer;
+ var selectionEndOffset = selectionRange.endOffset;
+
+ // select our link and unlink
+ var range = document.createRange();
+ var a = this.getSelectedNode();
+ while (a.nodeName != "A") { a = a.parentNode; }
+ range.selectNode(a);
+ selection.removeAllRanges();
+ selection.addRange(range);
+
+ returnValue = this.document.execCommand("unlink", false, null);
+
+ // restore original selection
+ var selectionRange = document.createRange();
+ selectionRange.setStart(selectionStartContainer, selectionStartOffset);
+ selectionRange.setEnd(selectionEndContainer, selectionEndOffset);
+ selection.removeAllRanges();
+ selection.addRange(selectionRange);

here: http://mail-archives.apache.org

Actions #20

Updated by Stanislas Rolland almost 15 years ago

Please try attached patch.

After modifying the script, you must delete all files from directory typo3temp/rtehtmlarea and clear the browser cache.

Actions #21

Updated by Michael almost 15 years ago

Seems to work fantastic. Great work. Thank you so much :-)

Actions #22

Updated by Stanislas Rolland almost 15 years ago

Committed to SVN TYPO3core trunk (revision 6657), branch TYPO3_4-3 (revision 6658) and branch TYPO3_4-2 (revsion 6659).

Actions #23

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF