id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blockedby,blocking 2337,Bug on image link or href link in a LinkPane’s tab of a TabContainer.,guest,mumme,"= Version of Dojo and build name if applicable = 0.4.1 = Browser versions and platforms where the bug occurs = Firefox 1.0, 2.0 on Mac OS Tiger [[BR]] IE7 on Windows XP = Error messages displayed (if any) = Error on the web page loading a tab image (red cross instead of the required image) = A contact address so we can follow-up with you = = Describe the exact situation in which the bug occurs as precisely as possible. Is it reproducible? Did it break in a certain release? Is it still an issue with nightly or subversion head? etc. = Neither an image nor a link can be displayed from a LinkPane’s tab of a TabContainer. [[BR]] I’m using DOJO in a ZOPE web application. I load the whole DOJO Toolkit as a Product, loaded via the FileSystem Directory in the ZOPE Management Interface. [[BR]] Then, to display an icon into a LinkPane tab of a TabContainer, I wrote the following code as a page template: (cf the '''Bug on image link or href link in a LinkPane’s tab of a TabContainer''' section) [[BR]] The tab label is well displayed but the tab image isn’t found. The interpreted code of the web page show that the src=”” attribute of is double quoted… the browser then try to find the and the same problem remains on hyperlink as PageContainer (PageController defining a widget) -> HtmlWidget => DomWidget [[BR]] I found the code which quote html attributes in the buildFromTemplate() function of DomWidget.js file, from lines 797 to 815 [[BR]] {{{ // FIXME: this is a lot of string munging. Can we make it faster? for(var i = 0; i < matches.length; i++) { var key = matches[i]; key = key.substring(2, key.length-1); // //dojo.debug('key in loop: ' + hash[key]); //undefined var kval = (key.substring(0, 5) == ""this."") ? dojo.lang.getObjPathValue(key.substring(5), this) : hash[key]; var value; // dojo.debug('kval: ' + kval); //dojo.debug('value: ' + value); if((kval)||(dojo.lang.isString(kval))){ value = new String((dojo.lang.isFunction(kval)) ?, key, this.templateString) : kval); // Safer substitution, see heading ""Attribute values"" in // // //dojo.debug('new value: ' + value); // FIXME: EC -> Add too much quote. // This function seems to be called twice while (value.indexOf("""""") > -1) { value=value.replace("""""","""""); } tstr = tstr.replace(matches[i], value); // //dojo.debug('final tstr: ' + tstr); } } }}} Debugging browser comments (corresponds to one tab of a TabContainer): '' DEBUG: fillInTemplate from PageContainer DEBUG: txt createNodesFromText
DEBUG: kval: Tab 2 DEBUG: kval: display: none DEBUG: txt createNodesFromText
Tab 2
DEBUG: fillInTemplate '' DEBUG: kval: Tab 2 Show that the image pass first into the function as a tab label so that “ are replaced by " These “"” caracters are the problem so that the tab’s image link can’t work. [[BR]] It shouldn’t be done like that. [[BR]] This function seems to be called twice on the same “src” attribute. Is it because the PageController is calling twice as well? [[BR]] Note: this bug didn’t exist in previous DOJO release. [[BR]] = Testcases and patches are even better = '''Test with the following page template:''' {{{ from the dojodemoswidget example --> TabContainer Demo

These tabs are made up of local and external content. Tab 1 and Tab 2 are loading files tab1.html and tab2.html. Tab 3 and Another Tab are using content that is already part of this page.

First Tab

I'm the first tab and my content is local.
Tab 2
}}} ",defect,closed,high,0.9,Dijit,0.4.1,fixed,LinkPane img,,,