The Problem

After the commit c5fd6239c045c1a00ba53d8af61cbd4db512bc30 I get the following error:

PHP Fatal error: Call to a member function get() on boolean in /var/www/xxx/modules/contrib/migrate_tools/src/Controller/MigrationListBuilder.php on line 129

Reverting back to 8.x-4.0-beta1 fixes the problem.

temporary workaround

Until this is resolved try using beta3 of both migrate_plus and migrate_tools.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hugronaphor created an issue. See original summary.

hugronaphor’s picture

Issue summary: View changes
heddn’s picture

Steps to reproduce and patches welcome.

heddn’s picture

gaurav.goyal’s picture

Hey @heddn,

We are also facing the same problem and occurrence of this issue is at random intervals. Once we clear cache, it goes away but after running migration twice, it comes back.

We generally see this error while executing - `drush ms` and we are using latest version(8.x-4.0-beta1) of migrate_tools module.

gaurav.goyal’s picture

Updating both migrate_plus & migrate_tools modules to 8.x-4.0-beta1 fixes the above issue.

hugronaphor’s picture

Status: Active » Closed (outdated)

I'm not getting this error anymore so, I'm closing it.

vasike’s picture

Status: Closed (outdated) » Active

i got this on UI
http://d8/admin/structure/migrate/manage/migrate_drupal_7/migrations
with the latest 8.4.dev

here is the "wsod" full message

The website encountered an unexpected error. Please try again later.
Error: Call to a member function get() on boolean in Drupal\migrate_tools\Controller\MigrationListBuilder->buildRow() (line 145 of modules/contrib/migrate_tools/src/Controller/MigrationListBuilder.php).

Drupal\migrate_tools\Controller\MigrationListBuilder->buildRow(Object) (Line: 233)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 22)
Drupal\Core\Entity\Controller\EntityListController->listing('migration')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
babis.p’s picture

Priority: Normal » Critical

I'm changing this to critical because this error happens even with the Beer migrations in migrate_example, and it make migrate_tools unusable - I cannot run a single migration.

At the same time, drush migrate-status displays an empty table, with no migrations in it. I guess it is due to this exact bug.

ifrik’s picture

I had the same problem because composer had installed the wrong version of Migrate Plus - an 8.2 version.

Using 4.0-beta3 for both Migrate Plus and Migrate Tools works for me.

Gold’s picture

Issue summary: View changes

Using 4.0-beta3 for both Migrate Plus and Migrate Tools works for me.

+1 for this. This has been driving me nuts for days now.

matthieuscarset’s picture

Using 4.0-beta3 for the two modules migrate_plus and migrate_tools still raise an exception for me:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\migrate\Plugin\Migration::getProcessNormalized() must be of the type array, null given, called in /app/web/core/modules/migrate/src/Plugin/Migration.php on line 630 in Drupal\migrate\Plugin\Migration->getProcessNormalized() (line 391 of core/modules/migrate/src/Plugin/Migration.php).
Drupal\migrate\Plugin\Migration->getProcessNormalized(NULL) (Line: 630)
Drupal\migrate\Plugin\Migration->findMigrationDependencies(NULL) (Line: 618)
Drupal\migrate\Plugin\Migration->getMigrationDependencies() (Line: 122)
Drupal\migrate\Plugin\MigrationPluginManager->createInstances(Array, Array) (Line: 100)
Drupal\migrate\Plugin\MigrationPluginManager->createInstance('my_custom_migration') (Line: 144)
Drupal\migrate_tools\Controller\MigrationListBuilder->buildRow(Object) (Line: 233)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 22)
Drupal\Core\Entity\Controller\EntityListController->listing('migration')
call_user_func_array(Array, Array) (Line: 123)
...
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
LOBsTerr’s picture

I had a similar issue. As result, migrate_plus version was out of date. The upgrade to the latest version (4.0.0-beta3) solved the issue

migrate_tools - 4.0.0-rc1

heddn’s picture

Status: Active » Postponed (maintainer needs more info)

I need more help on reproducing this. Is it that an update solves things and time has passed enough that this is no longer an issue?

awolfey’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Active

I get this after setting a migration status to false and importing config.
status: false
Setting it back to false and importing causes the error to go away.

$migration = $this->migrationPluginManager->createInstance($migration_entity->id());
sets $migration to false. We need to return NULL there. I'll make a patch.

awolfey’s picture

Status: Active » Needs review
FileSize
699 bytes
awolfey’s picture

Fix comment number.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
+++ b/src/Controller/MigrationListBuilder.php
@@ -142,6 +142,9 @@ class MigrationListBuilder extends ConfigEntityListBuilder implements EntityHand
+        return NULL;

We don't need to return NULL explicitly. That is the default if we just return;.

However, I'd also like to see some tests of this. This should be possible by just tweaking and copy/pasting some of the existing ones. See MigrateExecutionFormTest as an example.

sandboxpl’s picture

I've updated the patch with simplified return statement, gonna try to figure out some tests soon

sandboxpl’s picture

Allright, attached two patches:

First is test only containing new test with following bits and pieces:

  • Create new configs in migrate_tools_test submodule:
    • migrate_plus.migrate_group.disabled - provides separete migration group to test disabled groups and avoid conflicts with existing default group
    • migrate_plus.migration.fruit_terms_disabled - a clone of fruit_terms migration with status set to false, assigned to disabled group
  • Provide MigrateListBuilderTest class with following tests:
    • Visit list of migrations in default group, here everything should be fine
    • Visit list of migrations in disabled group, here we should be able reproduce an error

Second patch contains new tests + fix for the error.

Expected result of test-only patch:

html/docroot$ ../vendor/bin/phpunit -c core/ --filter=MigrateListBuilderTest
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Testing 
.E                                                                  2 / 2 (100%)

Time: 42.54 seconds, Memory: 1.30 GB

There was 1 error:

1) Drupal\Tests\migrate_tools\Functional\MigrateListBuilderTest::testMigrateListBuilderDisabled
Exception: Error: Call to a member function id() on bool
Drupal\migrate_tools\Controller\MigrationListBuilder->buildRow()() (Line: 150)


/var/www/html/docroot/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:51
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:203
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:156
/var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php:47
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:246
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:223
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:267
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:225
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:182
/var/www/html/vendor/fabpot/goutte/Goutte/Client.php:180
/var/www/html/vendor/symfony/browser-kit/Client.php:318
/var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:145
/var/www/html/vendor/behat/mink/src/Session.php:148
/var/www/html/docroot/core/tests/Drupal/Tests/UiHelperTrait.php:326
/var/www/html/docroot/modules/contrib/migrate_tools/tests/src/Functional/MigrateListBuilderTest.php:46

ERRORS!
Tests: 2, Assertions: 9, Errors: 1.

Expected result of test+fix patch:

html/docroot$ ../vendor/bin/phpunit -c core/ --filter=MigrateListBuilderTest
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Testing 
..                                                                  2 / 2 (100%)

Time: 39.62 seconds, Memory: 1.30 GB

OK (2 tests, 10 assertions)
sandboxpl’s picture

so test went as expected, but oh my, now I have to figure out how to copy it into drupalspoons gitlab thingy :o

sandboxpl’s picture

Status: Needs work » Needs review
Grevil’s picture

Just ran into a similar Problem "Call to a member function id() on bool in Drupal\migrate_tools\Controller\MigrationListBuilder->buildRow()", the patch from @sandboxpl fixed it though!

Also the code example for the hook_migration_plugins_alter is not working with migrate_tools enabled: https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api...

Thx everyone!

Grevil’s picture

Status: Needs review » Reviewed & tested by the community

Patch #20 works perfectly!

Anybody’s picture

Issue tags: -Needs tests

Confirming RTBC! :) Removing needs-tests as they are present now as of #20.

  • heddn committed 6d87c57 on 8.x-5.x authored by sandboxpl
    Issue #2894708 by sandboxpl, awolfey, heddn: PHP Error: Call to a member...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the contributions.

Status: Fixed » Closed (fixed)

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