hi
not sure if this is something with PHP 5.4 or something else but the following has suddenly started breaking as described:
the PHP file sections of interest:
$region_id = getvarint("region_id"); // "getvarint" is a function i wrote that works - i use it in all my projects - the correct value is returned
include_once("../common/tbs_class.php");
$TBS = new clsTinyButStrong;
$TBS->MethodsAllowed = true;
$TBS->LoadTemplate("vehicle_escort.tpl","UTF-8");
$TBS->MergeBlock("rg","mysql","select region_id,name from tbl_regions order by name");
$TBS->Show();
function do_rgs($block,$row,$recnum)
{
global $region_id;
$row['sel'] = ($region_id == $row['region_id'] ? "selected" : "");
}
|
the template section of interest:
<label for="region_id">Region</label><select id="region_id" name="region_id">
<option value='0'>Select Region...</option><option value="[rg.region_id;block=option;ondata=do_rgs]" [rg.sel]>[rg.name]</option>
</select>
|
now this arrangement would always draw the select list with the correct option selected based on whether it is the currently selected region_id
suddenly it has stopped working altogether, and spitting out a bunch of messages so:
TinyButStrong Error in field [rg.sel...]: item 'sel' is not an existing key in the array. This message can be cancelled using parameter 'noerr'.
|
anybody have any clues wht might be wrong here?
i am running debian with PHP 5.4.0 - i did find other stuff has changed in PHP 5.4.0, for example, they now have a built in "hex2bin" function, so other changes are possible i guess although i have no idea if this is the cause, or what would be breaking inside of TBS
thanks