Categories > TinyButStrong general >

[Bug] multiple mko not working

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Sheepy
Date: 2015-12-04
Time: 06:28

[Bug] multiple mko not working

TBS version: 3.10.1 for PHP5

$x = 1;
$tbs = new clsTinyButStrong();
$tbs->Source = "a<div>b[onshow.x;magnet=div;ope=mko:1,mko:2]c</div>d";
$tbs->Show();

Expected: mko triggers magnet.
Result: magnet is not triggered.

The code is composed from manual's example in ope param's description.

Sorry don't have time to help debug...
By: Skrol29
Date: 2015-12-06
Time: 00:36

Re: [Bug] multiple mko not working

Hi Sheepy,

Thanks very much for this bug report.
The bug exists from TBS version 3.5.2 to version 3.10.1.

The bug is that using several "mko", or using several "mok" in the same TBS field will not work properly.

The bug will be fixed in the next TBS version but you can fix it by replacing :
                    } elseif ($x==='mok:') {$Loc->OpeAct[$i] = 9; $Loc->OpeMOK[] = trim(substr($ope,4)); $Loc->MSave = $Loc->MagnetId;
                    } elseif ($x==='mko:') {$Loc->OpeAct[$i] =10; $Loc->OpeMKO[] = trim(substr($ope,4)); $Loc->MSave = $Loc->MagnetId;
with :
                    } elseif ($x==='mok:') {$Loc->OpeMOK[] = trim(substr($ope,4)); $Loc->MSave = $Loc->MagnetId; if (!isset($mkk)) $Loc->OpeAct[$i] =  9; $mkk = true;
                    } elseif ($x==='mko:') {$Loc->OpeMKO[] = trim(substr($ope,4)); $Loc->MSave = $Loc->MagnetId; if (!isset($mkk)) $Loc->OpeAct[$i] = 10; $mkk = true;
By: Sheepy
Date: 2015-12-09
Time: 04:01

Re: [Bug] multiple mko not working

Thanks for the quick fix!