Project

General

Profile

Actions

Bug #19119

closed

Change case in a filename from fileadmin don't take into account by rtehtmlarea with Firefox

Added by Frederic Hebert almost 16 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-07-17
Due date:
% Done:

0%

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

Description

You have uploaded a file in fileadmin, lets say in lowercase and then made a link to it in the RTE.
Then, you want to rename the file via "Files" module, in uppercase or first word uppercase, WITHOUT change the name by itself (same tokens). When you want to update the link in the RTE, changes are not taken into account : your link is to the old filename, in lowercase.
It's not a matter of uppercase/lowercase : if you delete the link and then relink it to the new filename, it works.

This bug is relevant to only Firefox 1.5 / 2.0 on linux and windows and MAYBE to IE6 (could not test it), NOT to IE7.
That's why, I think it's a javascript error and not a "browser link" error : links are good in list produced by browse_links.php.

Maybe, there is a javascript handler activated when you click on the choosen file in browser link.
Not enough skills to see it more efficiently.

(issue imported from #M8996)


Files

rtehtmlarea_bugfix_8996.patch (811 Bytes) rtehtmlarea_bugfix_8996.patch Administrator Admin, 2008-08-11 20:44
rtehtmlarea_bugfix_8996_span.patch (908 Bytes) rtehtmlarea_bugfix_8996_span.patch Administrator Admin, 2008-09-08 18:19
Actions #1

Updated by Administrator Admin almost 16 years ago

More info on the linker process in rtehtmlarea (surely to be confirmed) :

1- click on a link in the browser element (files element)
2- call to link_folder function
3- call to editor.renderPopup_addLink function (see rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers.js)
At this stage of the process, urls are quite good. The letter case is taken into account :

[CODE]

HTMLArea.prototype.renderPopup_addLink = function(theLink,cur_target,cur_class,cur_title) {

// DEBUG
alert (theLink);
// DEBUG
var a, sel = null, range = null, node = null, imageNode = null;
this.focusEditor();
node = this.getParentElement();
var el = HTMLArea.getElementObject(node,"a");
if (el != null && el.tagName && el.tagName.toLowerCase() == "a") node = el;
if (node != null && node.tagName && node.tagName.toLowerCase() == "a") this.selectNode(node);
// Clean images from existing anchors otherwise Mozilla may create nested anchors
if (this.classesAnchorSetup) {
sel = this._getSelection();
range = this._createRange(sel);
this.cleanAllLinks(node, range, true);
}

this._doc.execCommand("CreateLink", false, theLink);
sel = this._getSelection();
range = this._createRange(sel);
node = this.getParentElement();
var el = HTMLArea.getElementObject(node,"a");

//DEBUG
alert (el);
//DEBUG

if (el != null && el.tagName && el.tagName.toLowerCase() == "a") node = el;
if (node) {
if (this.classesAnchorSetup && cur_class) {
for (var i = this.classesAnchorSetup.length; --i >= 0;) {
var anchorClass = this.classesAnchorSetup[i];
if(anchorClass['name'] == cur_class && anchorClass["image"]) {
imageNode = this._doc.createElement("img");
imageNode.src = anchorClass["image"];
imageNode.alt = anchorClass["altText"];
break;
}
}
}
// We may have created multiple links in as many blocks
this.setLinkAttributes(node, range, cur_target, cur_class, cur_title, imageNode);
}
Dialog._modal.close();
this.updateToolbar();
};

[/CODE]

The first alert, output the good URL, the second do not : instead, in our special case mentionned above, it returns the string in lowercase (the old)

The only function that I could not trace it this :
this._doc.execCommand("CreateLink", false, theLink);

It seems to not to be called (ie an "alert" in HTMLArea::_createLink () function don't output anything). I didn't understood that.

Any hint ?

Thx

Actions #2

Updated by Stanislas Rolland almost 16 years ago

I could reproduce the issue with TYPO3 4.2.1 and FF3.0 as well as FF2.0.0.16. Looks like a browser bug. Will need to work around somehow...

Actions #3

Updated by Stanislas Rolland almost 16 years ago

execCommand is a method of the document object.

Actions #4

Updated by Stanislas Rolland almost 16 years ago

The attached patch fixes the issue.

Actions #5

Updated by Stanislas Rolland almost 16 years ago

Fixed in SVN TYPO3core branches TYPO3_4-2 (revision 3959) and
trunk (revision 3962).

Actions #6

Updated by Stanislas Rolland almost 16 years ago

The committed patch had an unwanted side effect. FF would sometimes add a span element inside the new link.

Actions #7

Updated by Stanislas Rolland almost 16 years ago

Follow-up patch committed to SVN TYPO3core branch TYPO3_4-2 (revision 4076) and trunk (revision 4077).

Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF