b***@bugzilla.maptools.org
2008-08-12 12:26:31 UTC
http://bugzilla.maptools.org/show_bug.cgi?id=1931
Summary: plugin Routing (cartoweb 3.4.0)
Product: CartoWeb
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Plugins
AssignedTo: cartoweb-***@lists.maptools.org
ReportedBy: ***@ensg.eu
there is a problem in ServerRouting.php (l 407) :
protected function convertNodeId($nodeId) {
$db = $this->getDb();
$table = $this->getConfig()->postgresRoutingTable;
$id = $db->getOne("SELECT id FROM {$table}_vertices WHERE geom_id ILIKE
'$nodeId'");
Utils::checkDbError($db);
return $id;
}
I had an error in the SELECT : I don't know why ILIKE wasn't accepted by
postgres and it worked with "SELECT id FROM {$table}_vertices WHERE geom_id =
'$nodeId'".
Utils::checkDbError($db) is supposed to give an exception if there is an error.
But checkDbError($db) (see file common/Utils.php)gives an exception only if
PEAR::isError($db) is true. And PEAR::isError($db) is true if $db is an object
from the class PEAR::PEAR_Error.
Visibly, $db can be right (connexion to PostgreSQL ok) and the query (SELECT
...) can be wrong. In that case, $id is an object DB_Error and $db is not.
I replaced line 407 with :
Utils::checkDbError($id);
and I got an exception which showed me the issue whith my query SELECT.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Please do NOT reply to this email, use the link above instead to
login to bugzilla and submit your comment. Any email reply to this
address will be lost.
Summary: plugin Routing (cartoweb 3.4.0)
Product: CartoWeb
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Plugins
AssignedTo: cartoweb-***@lists.maptools.org
ReportedBy: ***@ensg.eu
there is a problem in ServerRouting.php (l 407) :
protected function convertNodeId($nodeId) {
$db = $this->getDb();
$table = $this->getConfig()->postgresRoutingTable;
$id = $db->getOne("SELECT id FROM {$table}_vertices WHERE geom_id ILIKE
'$nodeId'");
Utils::checkDbError($db);
return $id;
}
I had an error in the SELECT : I don't know why ILIKE wasn't accepted by
postgres and it worked with "SELECT id FROM {$table}_vertices WHERE geom_id =
'$nodeId'".
Utils::checkDbError($db) is supposed to give an exception if there is an error.
But checkDbError($db) (see file common/Utils.php)gives an exception only if
PEAR::isError($db) is true. And PEAR::isError($db) is true if $db is an object
from the class PEAR::PEAR_Error.
Visibly, $db can be right (connexion to PostgreSQL ok) and the query (SELECT
...) can be wrong. In that case, $id is an object DB_Error and $db is not.
I replaced line 407 with :
Utils::checkDbError($id);
and I got an exception which showed me the issue whith my query SELECT.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Please do NOT reply to this email, use the link above instead to
login to bugzilla and submit your comment. Any email reply to this
address will be lost.