By: Sheepy
Date: 2014-03-11
Time: 08:55
|
Bug? PHP warning when using attadd with atttrue.
Hi skrol29,
Ran into a PHP warning while playing with attributes.
TBS v3.9.0 PHP 5 date 2014-01-26
Notice: Undefined property: clsTbsLocator::$AttName in C:\www\wsf\_addiah\template_tbs\tbs_class.php on line 1492
(meth_Locator_Replace)
$tbs = new clsTinyButStrong();
$tbs->Source = "<b class='name'> [data; ifempty=has_date; att=input#class; attadd; atttrue=has_date] </b>";
$tbs->MergeField( 'data', time() );
$tbs->Show(); |
I am trying to add a fixed class name when data timestamp is empty. Apparently atttrue is the wrong way. :p
- Sheepy
|
By: Sheepy
Date: 2014-03-11
Time: 09:16
|
Re: Bug? PHP warning when using attadd with atttrue.
An update. Apparently the notice will come up when you have atttrue and the attrbibute already exists.
$tbs = new clsTinyButStrong();
$tbs->Source = "<b attr='val'> [data; att=attr; atttrue=1] </b>";
$tbs->MergeField( 'data', time() ); |
|
By: Skrol29
Date: 2014-03-11
Time: 23:28
|
Re: Bug? PHP warning when using attadd with atttrue.
Thank you for reporting this problem.
I will check that and try to put a fix.
But it seems to me that your solution cannot work: parameter "atttrue" forces the attribute to be this way: myatt="myatt".
Another point is that when you us parameter "att" the field is move to the attribute all the time. So in your example it will replace class='name' for any value of "data".
|
By: Sheepy
Date: 2014-03-12
Time: 06:38
|
Re: Bug? PHP warning when using attadd with atttrue.
Hi Skrol29,
Thanks for the prompt reply. Sorry the example is not the exact code, yes I realised that ;if ;then ;else is better suited for the effect I want. By their nature attadd is incompatible with atttrue, I just wanted to see what may happens.
Don't worry about my side, I just think TBS shouldn't raise a notice on second example, which is a valid scenario in my eyes (for example, filling in a default attribute for design mode, and replacing it or removing it when running).
- Sheepy
|
|
Posting in progress.
Please wait...
|