I installed the module and activated it. The module created database tables "entity" and "entity_geom".

I triggered sync and cron and database table "entity" has beeen populated, but "entity_geom" did not.
No error were thrown by module (except cron timeout, i had to run cron multiple times but i have over 2000 nodes with Geofield)

I have a Postgres 9.1.3 with PostGIS 2.0.0 installed (AFAIK basic insert functions should be same as PostGIS v 1.5.3)

Is there any way to enable debugging or some documentation?

CommentFileSizeAuthor
#1 Schermata 04-2456030 alle 15.29.58.png42.51 KBFeBus982
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

FeBus982’s picture

I got this error in log entries. maybe function should be ST_GeomFromText() ?

PDOException: SQLSTATE[42883]: Undefined function: 7 ERROR: function geomfromtext(unknown, integer) does not exist LINE 1: UPDATE entity_geom SET geom = GeomFromText('POINT (13.9719 4... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.: UPDATE {entity_geom} SET geom = GeomFromText('POINT (13.9719 40.9872)', 4326) WHERE id = :id; Array ( [:id] => 3804 ) in sync_postgis_insert() (line 544 of /var/www/vhosts/skytest.it/meteomed/sites/all/modules/sync_postgis/sync_postgis.module).

I attached a screenshot of function being present inside database. Functions and tables are both inside "public" schema.

FeBus982’s picture

Status: Active » Needs review

Substituting "GeomFromText" with "ST_GeomFromText" on lines 544 and 588 in file sync_postgis.module solves this bug. :)

phayes’s picture

Yup, should definitely be using ST_ commands wherever possible

tnightingale’s picture

Title: Geofield don't sync » Support PostGIS 2.x - Update usage of non-prefixed functions
Assigned: Unassigned » tnightingale
Status: Needs review » Needs work

I'm not particularly familiar with the PostGIS releases but it seems that non-prefixed function names have been deprecated for a while now and removed entirely in the 2.x branch.

A temporarily solution for those using PostGIS 2.x is to run the bundled legacy.sql script on your database which will add support for non-prefixed function calls. This can easily be uninstalled with the matching uninstall_legacy.sql script.
I believe that newer versions of the 1.x branch support (and recommend) usage of the prefixed function calls. I will verify this and commit a proper fix along with notes on which minimum version of PostGIS we support.

If anyone (phayes?) has more knowledge on changes between PostGIS versions it would be great if you could fill us in and save me some digging. :-)

tnightingale’s picture

Status: Needs work » Fixed

Added prefixes as they appear to work on PostGIS ~ >1.3.3, see 7.x-1.x.

Documentation needed: #1618094: Determine PostGIS/Postgres minimum requirements

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.