Bug #19119
closedChange case in a filename from fileadmin don't take into account by rtehtmlarea with Firefox
0%
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
Updated by Administrator Admin over 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
Updated by Stanislas Rolland over 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...
Updated by Stanislas Rolland over 16 years ago
execCommand is a method of the document object.
Updated by Stanislas Rolland over 16 years ago
The attached patch fixes the issue.
Updated by Stanislas Rolland over 16 years ago
Fixed in SVN TYPO3core branches TYPO3_4-2 (revision 3959) and
trunk (revision 3962).
Updated by Stanislas Rolland about 16 years ago
The committed patch had an unwanted side effect. FF would sometimes add a span element inside the new link.
Updated by Stanislas Rolland about 16 years ago
Follow-up patch committed to SVN TYPO3core branch TYPO3_4-2 (revision 4076) and trunk (revision 4077).