diff --git a/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php b/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php index f017023..395ea6c 100644 --- a/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php +++ b/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php @@ -115,7 +115,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable // anything else -- the block will simply have no PHP or request_path // visibility configuration. elseif ($this->skipPHP) { - throw new MigrateSkipRowException(sprintf("The block will have no PHP or request_path visibility configuration for destination '%s'.", $destination_property)); + throw new MigrateSkipRowException(sprintf("The block with bid '%d' from module '%s' will have no PHP or request_path visibility configuration for destination '%s'.", $row->getSourceProperty('bid'), $row->getSourceProperty('module'), $destination_property)); } } else { diff --git a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php index 693825c..a27f585 100644 --- a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php +++ b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php @@ -87,9 +87,16 @@ public function testTransformPhpDisabled() { public function testTransformException() { $this->moduleHandler->moduleExists('php')->willReturn(FALSE); $migration_plugin = $this->prophesize(MigrateProcessInterface::class); + $this->row = $this->getMockBuilder('Drupal\migrate\Row') + ->disableOriginalConstructor() + ->setMethods(['getSourceProperty']) + ->getMock(); + $this->row->expects($this->exactly(2)) + ->method('getSourceProperty') + ->willReturnMap([['bid', 99], ['module', 'foobar']]); $this->plugin = new BlockVisibility(['skip_php' => TRUE], 'block_visibility_pages', [], $this->moduleHandler->reveal(), $migration_plugin->reveal()); - $this->setExpectedException(MigrateSkipRowException::class, "The block will have no PHP or request_path visibility configuration for destination 'destinationproperty'."); - $transformed_value = $this->plugin->transform([2, 'migrateExecutable, $this->row, 'destinationproperty'); + $this->setExpectedException(MigrateSkipRowException::class, "The block with bid '99' from module 'foobar' will have no PHP or request_path visibility configuration for destination 'destinationproperty'."); + $this->plugin->transform([2, 'migrateExecutable, $this->row, 'destinationproperty'); } }