Bug #14757
closed
JSmenu with RealURL is broken (jsfunc.menu.js)
Added by old_cmelchior over 19 years ago.
Updated over 13 years ago.
Description
It looks like the bugfix in bug 0000649 is broken in 3.8. The baseurl is inserted twice thereby breaking the link.
I have tried removing the fix and it works in Firefox 1.0.4 and IE 6 with RealURL. Havn't tried other configurations.
(issue imported from #M1111)
Hi cmelchior!
I've the same baseurl-twice error in 3.8.0 final. But I didn't understand yet, how you fixed the problem. I also noticed the bugreport 0001167 (the same code line), but don't understand the interaction of this two problems yet.
I had the same problem and found a quick fix. In jsfunc.menu.js, function JSactivate there is a check for the base tag, that is required by real url, but it doesn't check if the linked url's are absolute or relative. The following replacement code adds this check, maybe someone can integrate it for the next releases!?
function JSactivate(level) {
var selectorBox = document[this.formname]["selector"+level];
var entryID = selectorBox.options[selectorBox.selectedIndex].value;
if (this.entry[entryID]) {
this.writeOut(this.entry[entryID].child,this.entry[entryID].openID,level+1);
if (this.entry[this.entry[entryID].parent]) {
this.entry[this.entry[entryID].parent].openID = entryID;
}
if (this.entry[entryID].url) {
if (document.getElementsByTagName("base")[0].href != "" && this.entry[entryID].url.substr(0,5) != "http:" && this.entry[entryID].url.substr(0,6) != "https:") {
this.entry[entryID].url = document.getElementsByTagName("base")[0].href + this.entry[entryID].url;
}
Simon's fix works for me.
Matthias Nagl
Why hasn't this bugfix been integrated in 3.8.1?? With the little changes from Simon the bug would be fixed!!
Matthias
Hi Matthias,
please calm down. The core devs are doing all the bugfixing work in their spare time, and nobody noticed this patch beforehand - and there were more important issues as well.
Greets, Sebastian
Sorry, my note wasn't meant as an insult - I appreciate the work of every os-developer and understand that some minor things as this bug are overlooked. I just was puzzled after the upgrade to see again a bug that I had almost forgotten and wanted to remind someone responsible that he could easily close it.
Hi,
I cannot fix this issue because I am no expert in this area at the moment - But I will set this bug to "acknowledged".
Greets, Sebastian
This bug seems not to be entirely fixed in 4.0. The base check is now made for http:// but the https:// is missing in my 4.0beta4 file 'jsfunc.menu.js'
Matthew
PS.
This is the magic line:
if (document.getElementsByTagName("base")[0].href != "" && this.entry[entryID].url.substr(0,5) != "http:" && this.entry[entryID].url.substr(0,6) != "https:") {
this.entry[entryID].url = document.getElementsByTagName("base")[0].href + this.entry[entryID].url;
}
According to the source code of the curren TYPO3 trunk (4.4), this fix is already included, so I'll close this one.
Also: I have JSMenu running on a few sites with RealURL and no problems whatsoever.
- Target version deleted (
4.4.0)
Also available in: Atom
PDF