Spelling mistake in the class RouteProcessor

Created on 13 June 2024, 6 months ago
Updated 17 June 2024, 6 months ago

I think there is a spelling mistake in the class RouteProcessor in processOutbound on line 32

  public function processOutbound($route_name, Route $route, array &$parameters, BubbleableMetadata $bubbleable_metadata = NULL): void {
    if ($route->hasDefault('_migrate_group')) {
      $parameters['migration_group'] = 'default';
      if ($this->entityTypeManager->hasHandler('migration', 'storage')) {
        $migration = $this->entityTypeManager
          ->getStorage('migration')
         ->load($parameters['migration']);
        if (($migration !== NULL) && $group = $migration->get('migration_group')) {
          $parameters['migration_group'] = $group;
        }
      }
    }
  }

I think it should be $parameters['migration_group'] not $parameters['migration'].

I came across this exception being throw in a different module and changing it seem to fix the issue.

[error] AssertionError: Cannot load the "migration" entity with NULL ID. in assert() (line 261 of /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php) #0 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(261): assert(false, 'Cannot load the...')
#1 /app/web/modules/contrib/migrate_tools/src/Routing/RouteProcessor.php(32): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#2 /app/web/core/lib/Drupal/Core/RouteProcessor/RouteProcessorManager.php(52): Drupal\migrate_tools\Routing\RouteProcessor->processOutbound('entity.migratio...', Object(Symfony\Component\Routing\Route), Array, Object(Drupal\Core\GeneratedUrl))

I'll work on getting a patch created.

🐛 Bug report
Status

Needs review

Version

6.0

Component

Code

Created by

🇨🇦Canada knowak

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024