Categories > TinyButStrong general >

Bug in TBS 3.7.0 with parentgrp and att

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Rudy
Date: 2011-09-21
Time: 11:07

Bug in TBS 3.7.0 with parentgrp and att

Hello,

I found a bug with merging parentgrp blocks combined with "att" (in my case for adding the class attribute).

Consider the following example:

HTML:
<div class="a">[data.a;block=div;parentgrp=a]
  <div class="b">[data.class;att=class;attadd]
    [data.b;block=div]
  </div>
</div>

Merge sample data:

    $tbs->mergeblock('data', array(
      array('a'=>1,'b'=>2,'c'=>'o'),
      array('a'=>1,'b'=>3,'c'=>'e'),
      array('a'=>1,'b'=>4,'c'=>'o'),
      array('a'=>2,'b'=>2,'c'=>'e'),
      array('a'=>2,'b'=>3,'c'=>'o'),
      array('a'=>2,'b'=>4,'c'=>'e')
    ));


Expected Result:

<div class="a">1
  <div class="b o">2</div>
  <div class="b e">3</div>
  <div class="b o">4</div>
</div>
<div class="a">2
  <div class="b e">2</div>
  <div class="b o">3</div>
  <div class="b e">4</div>
</div>

TBS 3.7.0 Result:

<div class="a">1
  <div class="b []">2</div>
  <div class="b []">3</div>
  <div class="b []">4</div>
</div>
<div class="a">2
  <div class="b []">2</div>
  <div class="b []">3</div>
  <div class="b []">4</div>
</div>

Apparently the att-value is replaced by "[]" somehow. If removing parentgrp, it works as expected.

Rudy
By: Skrol29
Date: 2011-09-23
Time: 02:55

Re: Bug in TBS 3.7.0 with parentgrp and att

Hello Rudy,

Thank you very muck for reporting this bug. I will have a look on it soon.

By: Rudy
Date: 2011-09-23
Time: 21:07

Re: Bug in TBS 3.7.0 with parentgrp and att

Hello Skrol,

thanks for looking into it. For now I solve that situation by simply putting the class field directly in the attribute, no need to change that back after it's fixed.

Another thing I'd like to ask, have you ever considered to host this great little piece of code on github making it possible to fork it?

Best regards
Rudy
By: Skrol29
Date: 2011-09-26
Time: 09:50

Re: Bug in TBS 3.7.0 with parentgrp and att

Hello Rudy,

TBS is already available by SVN on SourceForge :
  https://sourceforge.net/projects/tinybutstrong/