reduce notices

greggles - September 4, 2009 - 08:10
Project:Geo
Version:6.x-1.x-dev
Component:Geo API
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When I enabled the module I got a bunch of php notices related to some missing single quotes. If you look at core like comment.module you'll see a slightly different notation that matches what I do in the patch.

AttachmentSize
geo_notices.patch2.14 KB

#1

greggles - September 4, 2009 - 08:44

I found some more when adding a field:

# notice: Use of undefined constant GEO_SRID_DEFAULT - assumed 'GEO_SRID_DEFAULT' in /var/www/d6/sites/all/modules/geo/geo.module on line 7.
# notice: Use of undefined constant GEO_DEGREE_M - assumed 'GEO_DEGREE_M' in /var/www/d6/sites/all/modules/geo/geo.module on line 8.
# notice: Use of undefined constant GEO_TYPE_POINT - assumed 'GEO_TYPE_POINT' in /var/www/d6/sites/all/modules/geo/geo.module on line 10.
# notice: Use of undefined constant GEO_TYPE_CURVE - assumed 'GEO_TYPE_CURVE' in /var/www/d6/sites/all/modules/geo/geo.module on line 11.
# notice: Use of undefined constant GEO_TYPE_LINESTRING - assumed 'GEO_TYPE_LINESTRING' in /var/www/d6/sites/all/modules/geo/geo.module on line 12.
# notice: Use of undefined constant GEO_TYPE_SURFACE - assumed 'GEO_TYPE_SURFACE' in /var/www/d6/sites/all/modules/geo/geo.module on line 13.
# notice: Use of undefined constant GEO_TYPE_POLYGON - assumed 'GEO_TYPE_POLYGON' in /var/www/d6/sites/all/modules/geo/geo.module on line 14.
# notice: Use of undefined constant GEO_TYPE_COLLECTION - assumed 'GEO_TYPE_COLLECTION' in /var/www/d6/sites/all/modules/geo/geo.module on line 15.
# notice: Use of undefined constant GEO_TYPE_MULTIPOINT - assumed 'GEO_TYPE_MULTIPOINT' in /var/www/d6/sites/all/modules/geo/geo.module on line 16.
# notice: Use of undefined constant GEO_TYPE_MULTICURVE - assumed 'GEO_TYPE_MULTICURVE' in /var/www/d6/sites/all/modules/geo/geo.module on line 17.
# notice: Use of undefined constant GEO_TYPE_MULTILINESTRING - assumed 'GEO_TYPE_MULTILINESTRING' in /var/www/d6/sites/all/modules/geo/geo.module on line 18.
# notice: Use of undefined constant GEO_TYPE_MULTISURFACE - assumed 'GEO_TYPE_MULTISURFACE' in /var/www/d6/sites/all/modules/geo/geo.module on line 19.
# notice: Use of undefined constant GEO_TYPE_MULTIPOLYGON - assumed 'GEO_TYPE_MULTIPOLYGON' in /var/www/d6/sites/all/modules/geo/geo.module on line 20.
# notice: Undefined index: field_name in /var/www/d6/sites/all/modules/geo/modules/geo_field/geo_field.module on line 24.
# notice: Undefined index: geo_type in /var/www/d6/sites/all/modules/geo/modules/geo_field/geo_field.module on line 50.
# notice: Undefined index: field_name in /var/www/d6/sites/all/modules/geo/modules/geo_field/geo_field.module on line 24.
...
...
notice: Undefined index: #children in /var/www/d6/sites/all/modules/geo/geo.module on line 271.

Looking at line 24, a variable is assigned and never used. This next patch removes that.

I then tried creating some fields and creating nodes using those fields.

When creating nodes I got the error:

notice: Use of undefined constant GEO_DEFAULT_SRID - assumed 'GEO_DEFAULT_SRID' in /var/www/d6/sites/all/modules/geo/geo.inc on line 264.

Which seems to be a typo. Also fixed.

For some of these (especially the changes to the geo_field_widget_info and geo_set_value) I'm not sure it's the right decision, but it does get rid of notices without introducing any side effects that I could see in my quick testing.

AttachmentSize
geo_notices.patch 5.94 KB

#2

Allie Micka - November 9, 2009 - 17:44
Status:needs review» fixed

Applied - thanks!

#3

System Message - November 23, 2009 - 17:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.