I have try to install the latest Geo version and Drupal has shown this message:

user warning: Invalid default value for 'srid' query: CREATE TABLE geo ( `gid` INT NOT NULL auto_increment, `name` VARCHAR(255) NOT NULL, `title` VARCHAR(255) NOT NULL, `handler` VARCHAR(32) NOT NULL, `table_name` VARCHAR(255) DEFAULT NULL, `column_name` VARCHAR(255) DEFAULT NULL, `geo_type` INT NOT NULL, `srid` INT NOT NULL DEFAULT 'GEO_SRID_DEFAULT', `indexed` TINYINT DEFAULT 0, `data` TEXT DEFAULT NULL, PRIMARY KEY (gid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in C:\AppServ\www\newGeo\includes\database.inc on line 517.

Debugging the code, the error is placed in the geo.install field where:

        'srid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => GEO_SRID_DEFAULT,
        ),

and the GEO_SRID_DEFAULT is not replaced with their defined value in geo.api.inc (4326) and Drupal converts it in a string 'GEO_SRID_DEFAULT'. Then a SQL error is produced because an int value is axpected but is provided a string

Comments

allie micka’s picture

I am just going to hardcode it to -1 in the schema, because this maps to GEO_UNKNOWN, which is a more accurate default.

Will that work for you?

allie micka’s picture

Status: Active » Fixed

I have just committed the change I suggested.

plopesc’s picture

Thanks!!
It works fine now!!

Status: Fixed » Closed (fixed)

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