Hi

I've a migration class 'ProductMigration' declared as 'Products' (see code snippet).
But when I check this in the UI, I see 's' as the name (see screenshot).

When I change the name from 'Products' to 'Product' all is well. But I want to use 'Products' as the name.
If I add letters after the 's' in 'Products', everything from the 's' to the end is shown.

I suppose that everything I've done is correct because the product migration is the only migration where I'm having this issue.

Thanks in advance for helping me out.

function tadaaz_migrate_migrate_api()
{
  $api = array(
    'api' => 2,
    'groups' => array(
      'tax' => array(
        'title' => t('Taxonomy migrations'),
      ),
      'product' => array(
        'title' => t('Product/Staffel migrations'),
      ),
    ),
    'migrations' => array(
      'Colors' => array(
        'class_name' => 'ColorMigration',
        'group_name' => 'tax',
      ),
      'Styles' => array(
        'class_name' => 'StyleMigration',
        'group_name' => 'tax',
      ),
      'Products' => array(
        'class_name' => 'ProductMigration',
        'group_name' => 'product',
      ),
      'Staffels' => array(
        'class_name' => 'StaffelMigration',
        'group_name' => 'product',
      ),
    ),
  );
  return $api;

}

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -Migrate 2.7, -migrate_ui

Is it possible some hidden extended character crept in before the 's' in 'Products'? What does the query

select machine_name,length(machine_name) from migrate_status where class_name = 'ProductMigration'

report?

yerlix’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new43.06 KB

I've included a screenshot with the result.

All looks normal to me so far.

mikeryan’s picture

Ah, I get it now - the group machine name is 'product', and that gets stripped when it prefixes a migration (just on display, everything will work as it should). The motivation for this is that migration generators like migrate_d2d and wordpress_migrate prepend the group name to each migration name for disambiguation - the idea is that a list of migrations like 'Users', 'Pages', 'Comments' looks cleaner than 'MyOldLegacyBlogSiteUsers', 'MyOldLegacyBlogSitePages', 'MyOldLegacyBlogSiteComments'... I've been tempted before to take that out, this is a concrete reason to do that.

mikeryan’s picture

Version: 7.x-2.7 » 7.x-2.x-dev
Status: Active » Needs review
Issue tags: +Migrate 2.9
StatusFileSize
new1.3 KB

@yerlix, does this patch fix it for you?

Status: Needs review » Needs work

The last submitted patch, 4: migration_name_changes-2510010-4.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: migration_name_changes-2510010-4.patch, failed testing.

mikeryan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB

Rerolled.

mikeryan’s picture

  • mikeryan committed 72e1a81 on 7.x-2.x
    Issue #2510010 by mikeryan: Stop stripping group name prefixes from...
mikeryan’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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