I use this workaround to have the nid in the title with autonodoetitle http://drupal.org/node/360359#comment-2031680

After that geocode don't geocode any more...

Comments

gagarine’s picture

This issue in autonodetitle #194197: Use (T)NID as node title

EDIT: I found a solution for autonodetitle with this patch http://drupal.org/node/194197#comment-1936310
But i'm pretty sure that geocode don't work good with rules...

allie micka’s picture

Status: Active » Postponed (maintainer needs more info)

Hi gagarine,

Can you let me know the steps to reproduce this?

Thanks a lot!

gagarine’s picture

Ok i try to reproduce the bug with a simple installation and new version of geocode tomorrow...

gagarine’s picture

Assigned: Unassigned » gagarine
gagarine’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new89.26 KB

I try on fresh install with only geo alpha2 and cck with the widget long/lat.

I use the standard "page" type for my test with only one more field. The rules is trigerd on "After updating existing content" and only change the title to "hello bug" (see capture).

So After I update a content.... the line in the geo table is erased!

My content type "page" export:

$content['type']  = array (
  'name' => 'Page',
  'type' => 'page',
  'description' => 'A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'old_type' => 'page',
  'orig_type' => 'page',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => 0,
  'comment_default_mode' => 4,
  'comment_default_order' => 1,
  'comment_default_per_page' => 50,
  'comment_controls' => 3,
  'comment_anonymous' => 0,
  'comment_subject_field' => 1,
  'comment_preview' => 1,
  'comment_form_location' => 0,
);
$content['fields']  = array (
  0 => 
  array (
    'label' => 'My geo',
    'field_name' => 'field_my_geo_field',
    'type' => 'geo',
    'widget_type' => 'geo_latlon',
    'change' => 'Change basic information',
    'weight' => '31',
    'description' => '',
    'default_value' => 
    array (
      0 => 
      array (
        'geo' => 
        array (
          'lat' => '0',
          'lon' => '0',
        ),
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => NULL,
    'required' => 0,
    'multiple' => '0',
    'geo_type' => 'point',
    'srid' => 4326,
    'op' => 'Save field settings',
    'module' => 'geo',
    'widget_module' => 'geo_field',
    'columns' => 
    array (
      'geo' => 
      array (
        'type' => 'blob',
        'mysql_type' => 'geometry',
        'pgsql_type' => 'geometry',
        'gis type' => 'point',
        'description' => 'Geometry field',
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
  'title' => '-5',
  'body_field' => '0',
  'revision_information' => '20',
  'comment_settings' => '30',
  'menu' => '-2',
);
gagarine’s picture

Title: Geocode don't work with rules with triger "after the node is saved " » Rules triger "After updating existing content" erase Geo field
Project: Geocode » Geo
Version: 6.x-1.x-dev » 6.x-1.0-alpha2
Component: Code » Geo Field module
Status: Postponed (maintainer needs more info) » Active
gagarine’s picture

StatusFileSize
new89.26 KB

Apparently capture is gone....

gagarine’s picture

Version: 6.x-1.0-alpha2 »
Status: Postponed (maintainer needs more info) » Active

I try with the HEAD (6.x-1.x-dev 2009-Dec-22 ) and the bug is still here.

phayes’s picture

This is most likely directly related to this bug: http://drupal.org/node/667034

gagarine’s picture

Thanks. I try the patch http://drupal.org/node/667034#comment-2405094 but nothing change for me with rules... but now it's time to sleep for me :).

gagarine’s picture

With rules we go two times in the function geo_field into the case "presave".
- First time with an array (from the form)
- This array is converted into a WKB but NOT saved in the DB
- Second call of geo_field is from rules
- this time we have the WKB value from the first call so we have nothing to do
- BUT the workaround

$wkt = geo_value($item['geo'], 'wkt', $format);
$items[$k]['geo'] = geo_value($item['geo'], 'wkb', 'wkt');

Try to convert WKB -> WKT -> WKB. But this not work because this WKB is not from database. The transformation give number like "4.48165511052E-311" for "3" instead of "b/@".

WKB from DB is not the same of WKB from geo?

All the test is done with the patch http://drupal.org/node/667034#comment-2405094