TinyPortal

Development => Support => Topic started by: MASSch on June 12, 2009, 11:26:20 AM

Title: Bug in TPortal.template.php (and a fix)
Post by: MASSch on June 12, 2009, 11:26:20 AM
After upgrading TP to 1.0.8 beta comments for articles stopped to unfold. The problem was in TPortal.template.php line 468:
<div id="tp_article_comment windowbg2" ' , isset($story['options']['commentupshrink']) ? '' : 'style="display: none;"' , '>';

while the JS function unfolding the comment pane tried to access dom element 'tp_article_comment'. I've changed the line to:
<div id="tp_article_comment" ' , isset($story['options']['commentupshrink']) ? '' : 'style="display: none;"' , '>';

and now it works.
Hope this helps.
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: Uthn on June 20, 2009, 05:28:41 PM
Thanks, was getting mad at this  :)
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: ZarPrime on June 20, 2009, 09:29:09 PM
MASSch,

Welcome to TinyPortal.

If you are referring to TP 1.0 beta 4, this is probably the same bug that has already been reported.  See this topic ...
http://www.tinyportal.net/index.php?action=bugtracker;sa=bug512

I will put a link to this topic in the bug report as a possible bug fix for Bloc.

Thank You,
ZarPrime
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: MASSch on June 21, 2009, 05:39:13 PM
Sorry for the dupe, I've searched the site with queries like "comment unfold bug", but the word "uncollapsable" never came to my mind (and will not either). BTW, what's the deal with these "dual-class" style and DOM names like that "tp_article_comment windowbg2"? Are they any better than "usual" ones?

PS You can also change line 454 to
<a href="#tp-comment" onclick="swapOptionsArticle(\'tp_article_comment windowbg2\')"> instead of line 468.
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: ZarPrime on June 21, 2009, 06:28:31 PM
MASSch,

I don't know the answer to your question but perhaps Bloc will answer it when he sees this topic.

ZP
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: IchBin on June 22, 2009, 03:15:36 AM
The dual class allows you to apply styles to an element that you don't want to include into a single class. The advantage is that the styles don't have to be applied to all the elements. If you want to customize a single style and you only have one style applied, it applies to ALL the elements. Adding a second class eliminates that problem.
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: MASSch on June 22, 2009, 12:15:22 PM
Thanks, IchBin. I see Your point with classes, but this doesn't work at all with DOM id's!
Title: Re: Bug in TPortal.template.php (and a fix)
Post by: IchBin on June 22, 2009, 03:54:34 PM
Right, you are only allowed to have a single ID in a page. No duplicate names allowed. :)