I am using tera wurfl 2.1.3 and I am recieving these errors
Notice: Undefined offset: -1 in \terawurfl\DatabaseConnectors\TeraWurflDatabase_MySQL5.php on line 156
Notice: Undefined offset: -1 in \terawurfl\DatabaseConnectors\TeraWurflDatabase_MySQL5.php on line 158
Notice: Undefined offset: -1 in \terawurfl\DatabaseConnectors\TeraWurflDatabase_MySQL5.php on line 158
In my site setup I am using tera wurfl with mobile joomla which is a extension to joomla.These errors occur when my browser spoofs user agent of nokia 6300, ipad etc. and It doesn't occur only in case of IPhone(Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16).
Also, I have other sites who use tera wurfl directly and they don't display such errors in browser, but in eclipse PDT when it validate the entire site it displays the same errors.So I think this is a issue with tera wurfl.
In the function below condition in do loop is not getting true, so that the value of i remains 0 and hence error comes.
- Code: Select all
public function getDeviceFallBackTree($wurflID){
if($this->use_nested_set){
return $this->getDeviceFallBackTree_NS($wurflID);
}
$data = array();
$this->numQueries++;
$query = sprintf("CALL ".TeraWurflConfig::$TABLE_PREFIX."_FallBackDevices(%s)",$this->SQLPrep($wurflID));
$this->dbcon->multi_query($query);
$i = 0;
do{
if($res = $this->dbcon->store_result()){
$row = $res->fetch_row();
$data[$i++]=unserialize($row[0]);
$res->free();
}
}while($this->dbcon->more_results() && $this->dbcon->next_result());
if($data[$i-1]['id'] != WurflConstants::$GENERIC){
$tw = new TeraWurfl();
$tw->toLog("WURFL Error: device {$data[$i-1]['id']} falls back on an inexistent device: {$data[$i-1]['fall_back']}",LOG_ERR,__CLASS__.'::'.__FUNCTION__);
}
return $data;
}
Thanks,