Categories > TinyButStrong general >

html plugin stopped working

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Dany Alejandro
Date: 2009-08-24
Time: 19:49

html plugin stopped working

The "selected option" feature of the html plugin stopped working with recent versions (that, or my code doesn't work anymore). Please check this code, maybe I'm not using the plugin correctly...

To reproduce:

phpcode.php:
<?php
include_once('tbs_plugin_html.php');
include_once('tbs_class_php5.php');

$TBS = new clsTinyButStrong();
$myBlock = array("1" => "A", "2" => "B");
$mySelectedVal = "1";

$TBS->LoadTemplate('template.html', FALSE);
$TBS->MergeBlock("myBlock", $myBlock);
$TBS->Show();
?>

template.php:
<html><body>
<select>
    <option value="[myBlock.$]">[myBlock.val;block=option]</option>
    <option>[var.mySelectedVal;ope=html;select]</option>
</select>
</body></html>

Also, tbs_class_php5.php and tbs_plugin_html.php should be in the same folder.

Result: the plugin doesn't work, and a warning appears:
Warning: Parameter 5 to clsTbsPlugInHtml::OnOperation() expected to be a reference, value given in C:\wamp\www\pruebatbs\tbs_class_php5.php on line 2552
By: Skrol29
Date: 2009-08-24
Time: 23:18

Re: html plugin stopped working

Hello,

I don't have the problem.
Test with TBS 3.4.0 and TBS 3.5.0b2009-08-18.
HTML plugin version 1.0.6.

I've added:
   error_reporting(E_STRICT);
and no error are reported.

By: Dany Alejandro
Date: 2009-09-07
Time: 04:17

Re: html plugin stopped working

I'm currently using WAMP server (http://www.wampserver.com/en/) version 2.0i wich installs Apache / PHP /MySQL for me. The problem still appears. PHP version is 5.3.0 . Should be easy to reproduce.

By: Dany Alejandro
Date: 2009-09-07
Time: 04:25

Re: html plugin stopped working

Tested with PHP 5.2.0. Problem dissappears.
PHP 5.3 seems to make the problem appear.
Please check this out.
By: Skrol29
Date: 2009-09-07
Time: 17:43

Re: html plugin stopped working

Hello Dany,

Thank you very much for digging the problem. I can reproduce it too with PHP 5.3.0.

The bug is on the HTML plugin. You must replace
function OnOperation($FieldName,&$Value,&$PrmLst,&$Source,&$PosBeg,&$PosEnd,&$Loc) {
with
function OnOperation($FieldName,&$Value,&$PrmLst,&$Source,$PosBeg,$PosEnd,&$Loc) {

The fix for the HTML plugin is already available if you download the current TBS package. The new version of the HTML plugin is 1.0.7.

Once again, thank you very much Dany.