Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wondered how "cck fields"-views should be converted to fieldapi fields.
function node_views_convert($display, $type, &$view, &$field, $id = NULL) {
_views_convert_rename_table($field, 'node_revisions', 'node_revision');
switch ($type) {
case 'field':
// convert node body to fieldapi.
_views_convert_rename_table_field($field, 'node_revision', 'body', 'field_data_body', 'entity_id');
break;
I guess this module could implement the api.
Comments
Comment #1
joachim CreditAttribution: joachim commentedI don't know much about hook_views_convert(). When should it run? Field converter does its work in a batch operation on request, so I'm not sure implementing this hook would work.
Comment #2
dawehnerAs far as i read the module you have a hook to define the migration paths.
You could implement hook_views_convert and read out every migration path and use it on the hook.
Comment #3
joachim CreditAttribution: joachim commentedWhen does hook_views_convert get invoked?
Comment #4
dawehnerCurrently only when someone is calling
There is sadly no ui currently.
Comment #5
joachim CreditAttribution: joachim commentedAh right. Now I get it! :)
So we could add a setting to a migration plan, say
'convert_views' => TRUE
and if that's set, Field converter knows it should invoke hook_views_convert because the migration plan's module has that hook and wants it to run at the same time as the field conversion.
Comment #6
dawehnerExact.