This issue thread aims to tackle necessary work to implement migration of data from drupal 7 geofield to drupal 8 geofield. This patch makes use of the migrate process, geofield_latlon, and does updates to this migrate process. This patch also introduces an implementing class of CckFieldPluginBase. This patch aims to make possible this migrate_plus manifest :

Drupal 8 Target field : field_drupal8_geofield
Drupal 7 Source field : field_drupal7_geofield
field_drupal8_geofield:
   plugin: geofield_latlon
   source: field_drupal7_geofield

Comments

chriscalip created an issue. See original summary.

chriscalip’s picture

StatusFileSize
new2.1 KB

patch attached.

chriscalip’s picture

This is based on the workflow done by address module at Address Migration Integration

This patch provides

✝ vagrant@multi-vlad ✝ ../site/vlad_aux/d7d8-dev
$ drupal plugin:debug migrate.cckfield
 ------------------------- --------------------------------------------------------------- 
  Plugin ID                 Plugin class                                                   
 ------------------------- --------------------------------------------------------------- 
  address                   Drupal\address\Plugin\migrate\cckfield\Address                 
  file                      Drupal\file\Plugin\migrate\cckfield\d7\FileField               
  filefield                 Drupal\file\Plugin\migrate\cckfield\d6\FileField               
  geofield                  Drupal\geofield\Plugin\migrate\cckfield\Geofield               
  image                     Drupal\file\Plugin\migrate\cckfield\d7\ImageField              
  link                      Drupal\link\Plugin\migrate\cckfield\LinkField                  
  link_field                Drupal\link\Plugin\migrate\cckfield\d7\LinkField               
  taxonomy_term_reference   Drupal\taxonomy\Plugin\migrate\cckfield\TaxonomyTermReference  
  text                      Drupal\text\Plugin\migrate\cckfield\TextField                  
 ------------------------- --------------------------------------------------------------- 

With process plugin and cckfield plugin it allows us to do this migration_plus item manifest :

field_drupal8_geofield:
  plugin: geofield_latlon
  source: field_drupal7_geofield
chriscalip’s picture

This patch is reference by community documentation for migrate and geofield integration at :
https://www.drupal.org/node/2798907

Please update link if additional patches get thrown in. I imagine someone might want to add d6 source field.

badjava’s picture

I was getting an error with #2:

Plugin (geofield) instance class "Drupal\geofield\Plugin\migrate\cckfield\Geofield" does not exist.

Here is a patch with the corrected namespace.

chriscalip’s picture

Nice, I've updated the patch link on community documentation handbook.

gerzenstl’s picture

Status: Active » Needs review
StatusFileSize
new2.52 KB
new863 bytes

The previous patches worked fine, but had the issue that only migrated data for value attribute of the field.

I submitted a patch that fixes this issue and allows migrate the rest of the data that are lat, lon, left, right, top, bottom, geohash and geo_type attributes that are used on the different form widget of this field type.

sam152’s picture

I have already written the cckfield plugin with a test here #2825635: Implement a migrate cck field plugin for migrating from Drupal 7 to 8 and test the existing process plugin. This patch is also a backwards compatibility break, while the other issue is not.

timwood’s picture