Categories > TinyButStrong general >

MergeBlock, array, nodata

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: minimalist
Date: 2005-10-21
Time: 23:15

MergeBlock, array, nodata

Hi! I have this template:

<tr><td>[blk.col1;block=tr;ondata=myfunc]</td><td>[blk.col2]</td></tr>

I'd like to use the following user function to manipulate the records:

function myfunc($BlockName, &$CurrRec, $RecNum)
{
        $CurrRec["col1"] = "res1.1";
}

The block source type is array, defined this way:

$blkdata = array();
$blkdata[] = array("col1"=>"res1", "col2"=>"res2");

I merge the block:

$TBS->MergeBlock("blk", "array", "blkdata");

This returns the following message, and doesn't call the user function (leaves the col1 field as defined):

Warning: call_user_func_array(): First argumented is expected to be a valid callback, '' was given in /lib/tbs_class.php on line 431

Am I missed to define something in the header of the user function? When using MySQL as data source, it works well anyway.

Thank you for your help in advance.
By: Skrol29
Date: 2005-10-23
Time: 10:29

Re: MergeBlock, array, nodata

Hi Minimalist,

Thanks for reporting this problem. That was a bug which is now fixed with the patch TBS version 2.05.2 available for download.

The bug occured when using parameter "ondata" and using array data source, or when merging several block with the same query.
By: minimalist
Date: 2005-10-23
Time: 11:49

Re: MergeBlock, array, nodata

Hi Skrol29,

Now it works with the new version! :) Thank you for the fast answer and great support! Keep up the good work! :)