Hi all,
Some new information about the error that I reported yesterday. A search to a layer on the same database, that works well, shows the following result on pm_debug.log: [18-Sep-2013 13:15:47] P.MAPPER debug info XML->//definition SimpleXMLElement Object ( [@attributes] => Array ( [type] => suggest [connectiontype] => db [minlength] => 1 [startleft] => 0 [sort] => asc ) [comment] => SimpleXMLElement Object ( ) [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20 [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua ) [18-Sep-2013 13:15:50] P.MAPPER debug info request Array ( [searchitem] => n_rua2 [fldname] => rua [q] => norto [limit] => 0 [timestamp] => 1379502950458 ) [18-Sep-2013 13:15:50] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] => db [sort] => asc [minlength] => 1 [regexleft] => [startleft] => 0 [dependfld] => [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20 [encoding] => UTF-8 [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua [dependfldval] => ) [18-Sep-2013 13:15:50] P.MAPPER debug info SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua [18-Sep-2013 13:15:51] P.MAPPER debug info Searcharray in search.php->getSearchParameters() Array ( [rua] => Rua Norton de Matos [mode] => search ) [18-Sep-2013 13:15:51] P.MAPPER debug info Parameters for searchArray file: query.php->q_execAttributeQuery Array ( [rua] => Rua Norton de Matos [mode] => search ) [18-Sep-2013 13:15:51] P.MAPPER debug info Parameters for searchParams file: query.php->q_execAttributeQuery Array ( [layerName] => ruas [layerType] => postgis [firstFld] => rua [qStr] => rua ILIKE '%Rua Norton de Matos%' ) [18-Sep-2013 13:15:51] P.MAPPER debug info P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd: SELECT n_rua, ST_xmin(box3d(the_geom)), ST_ymin(box3d(the_geom)), ST_xmax(box3d(the_geom)), ST_ymax(box3d(the_geom)), n_rua,rua,comprimento FROM ruas WHERE rua ILIKE '%Rua Norton de Matos%' LIMIT 301 The layer that gives the Internal Server Error shows, on pm_debug.log: [18-Sep-2013 13:15:18] P.MAPPER debug info XML->//definition SimpleXMLElement Object ( [@attributes] => Array ( [type] => suggest [connectiontype] => db [minlength] => 1 [startleft] => 0 [sort] => asc ) [comment] => SimpleXMLElement Object ( ) [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria ) [18-Sep-2013 13:15:20] P.MAPPER debug info request Array ( [searchitem] => n_rede_viaria [fldname] => arteria [q] => no [limit] => 0 [timestamp] => 1379502920339 ) [18-Sep-2013 13:15:20] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] => db [sort] => asc [minlength] => 1 [regexleft] => [startleft] => 0 [dependfld] => [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial [encoding] => UTF-8 [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria [dependfldval] => ) [18-Sep-2013 13:15:20] P.MAPPER debug info SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria [18-Sep-2013 13:15:21] P.MAPPER debug info request Array ( [searchitem] => n_rede_viaria [fldname] => arteria [q] => norto [limit] => 0 [timestamp] => 1379502921111 ) [18-Sep-2013 13:15:21] P.MAPPER debug info Parameters for attribute search file: suggest.php function: __construct Array ( [type] => db [sort] => asc [minlength] => 1 [regexleft] => [startleft] => 0 [dependfld] => [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial [encoding] => UTF-8 [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria [dependfldval] => ) [18-Sep-2013 13:15:21] P.MAPPER debug info SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria [18-Sep-2013 13:15:22] P.MAPPER debug info Searcharray in search.php->getSearchParameters() Array ( [arteria] => R NORTON DE MATOS [mode] => search ) and on php_errors.log: [18-Sep-2013 11:15:22 UTC] PHP Warning: mapObj::getLayerByName(): getLayerByName failed for : geopnh , in /var/pmapper/incphp/query/search.php on line 116 [18-Sep-2013 11:15:22 UTC] PHP Fatal error: Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213 I have already tried the solutions proposed in this thread http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users but unsuccessfully. Anyone have suggestions? Thank you very much! Best regards, Pedro ____________________________________ ----- Original Message ----- From: Pedro Venâncio To: pmapper-users Sent: Tuesday, September 17, 2013 6:55 PM Subject: Internal Server Error with postgis search Hi, I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly. The search that does not work is this one: <searchitem name="n_rede_viaria" description="Rede Viaria"> <layer type="postgis" name="geopnh"> <field type="s" name="arteria" description="Nome da Arteria" wildcard="0"> <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc"> <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn> <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql> </definition> </field> </layer> </searchitem> With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38) POST http://localhost/incphp/xajax/x_info.php 500 Internal Server Error 6ms and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search May it be a result of the content of "arteria" field be in uppercase? How can I get around this? Thank you very much! Best regards, Pedro ------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users