[Cartoweb-dev] [Bug 1931] New: plugin Routing (cartoweb 3.4.0)

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Tue Aug 12 08:26:31 EDT 2008


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-dev at lists.maptools.org
        ReportedBy: clotilde.mohsen at 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.


More information about the Cartoweb-dev mailing list