diff --git a/src/Controller/PluginRevisionController.php b/src/Controller/PluginRevisionController.php index 061c223..3ac28d0 100644 --- a/src/Controller/PluginRevisionController.php +++ b/src/Controller/PluginRevisionController.php @@ -4,6 +4,7 @@ namespace Drupal\diff\Controller; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\diff\DiffLayoutManager; @@ -34,17 +35,27 @@ class PluginRevisionController extends ControllerBase { protected $diffLayoutManager; /** + * The entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** * Constructs a PluginRevisionController object. * * @param DiffEntityComparison $entity_comparison * DiffEntityComparison service. * @param DiffLayoutManager $diff_layout_manager * DiffLayoutManager service. + * @param EntityTypeManagerInterface $entity_type_manager + * The entity type manager. */ - public function __construct(DiffEntityComparison $entity_comparison, DiffLayoutManager $diff_layout_manager) { + public function __construct(DiffEntityComparison $entity_comparison, DiffLayoutManager $diff_layout_manager, EntityTypeManagerInterface $entity_type_manager) { $this->config = $this->config('diff.settings'); $this->diffLayoutManager = $diff_layout_manager; $this->entityComparison = $entity_comparison; + $this->entityTypeManager = $entity_type_manager; } /** @@ -53,7 +64,8 @@ class PluginRevisionController extends ControllerBase { public static function create(ContainerInterface $container) { return new static( $container->get('diff.entity_comparison'), - $container->get('plugin.manager.diff.layout') + $container->get('plugin.manager.diff.layout'), + $container->get('entity_type.manager') ); } diff --git a/src/Tests/DiffPluginTest.php b/src/Tests/DiffPluginTest.php index df78751..cfeab4d 100644 --- a/src/Tests/DiffPluginTest.php +++ b/src/Tests/DiffPluginTest.php @@ -221,9 +221,6 @@ class DiffPluginTest extends DiffTestBase { // "changed" field is not displayed since there is no plugin for it. This // should not break the revisions comparison display. $this->assertResponse(200); - $this->drupalGet('node/' . $node->id()); - // Check the difference between the last two revisions. - $this->clickLink(t('Revisions')); $this->assertLink(t('Standard')); }