Hi folks,

I got an error when installing migrate tools.

It's happening when using clean Drupal 8.1.x-dev or Drupal 8.2.x-dev version.
After enabling the module via drush or UI I got a white blank page and the error message

PHP Fatal error:  Call to a member function set() on null in .../web/modules/migrate_tools/migrate_tools.module on line 15

When using 8.1.0-beta1 it works fine, also for 8.0.x with 8.x-1.0 release.

Comments

mvogel created an issue. See original summary.

mikeryan’s picture

Status: Active » Closed (duplicate)

Getting the module to work with 8.1.x and beyond is in progress at #2667368: Make migrate_tools work with Drupal 8.1.x.

vdanielpop’s picture

Hey,
I'm getting the same error on a website that has Drupal core 8.1.1 and Migrate Tools 8.2.x-dev . Any help is appreciated.

sitiveni’s picture

Hi all,
Just upgraded core to 8.1.1 and tried to install 8.x-2.0-beta1 with the same error.
As the error says it can't call the methods on null. By adding a condition to check if that object/item exists I can install the module without errors.
Here's what I did (don't think it's worth a patch so it's code only) in the module file:

  if (isset($entity_types['migration'])) {
    $entity_types['migration']
      ->set('admin_permission', 'administer migrations')
      ...
  }

  if (isset($entity_types['migration_group'])) {
    $entity_types['migration_group']
      ->set('admin_permission', 'administer migrations')
      ...
  }
vdanielpop’s picture

Yes, I ended up doing that as well. I was more interested if there is a known source for this error, since I didn't have time to debug it myself. Thank you, though.

davidwbarratt’s picture

It looks like there is a patch for this in #2723457: entity_type not defined in alter causes fatal error so perhaps we should mark this issue as a duplicate (I realize this one is older).