Unverified Commit 4bd5cab3 authored by larowlan's avatar larowlan

Issue #2914287 by Sam152, Manuel Garcia: Entity links aren't added to views...

Issue #2914287 by Sam152, Manuel Garcia: Entity links aren't added to views using the revision table as a base
parent 6ab577bf
......@@ -253,6 +253,9 @@ public function getViewsData() {
}
$this->addEntityLinks($data[$base_table]);
if ($views_revision_base_table) {
$this->addEntityLinks($data[$views_revision_base_table]);
}
// Load all typed data definitions of all fields. This should cover each of
// the entity base, revision, data tables.
......
......@@ -933,9 +933,11 @@ public function testEntityLinks() {
$this->baseEntityType->setLinkTemplate('delete-form', '/entity_test/{entity_test}/delete');
$data = $this->viewsData->getViewsData();
$this->assertEquals('entity_link', $data['entity_test']['view_entity_test']['field']['id']);
$this->assertEquals('entity_link_edit', $data['entity_test']['edit_entity_test']['field']['id']);
$this->assertEquals('entity_link_delete', $data['entity_test']['delete_entity_test']['field']['id']);
foreach (['entity_test', 'entity_test_revision'] as $table_name) {
$this->assertEquals('entity_link', $data[$table_name]['view_entity_test']['field']['id']);
$this->assertEquals('entity_link_edit', $data[$table_name]['edit_entity_test']['field']['id']);
$this->assertEquals('entity_link_delete', $data[$table_name]['delete_entity_test']['field']['id']);
}
}
/**
......@@ -945,10 +947,13 @@ public function testEntityLinksJustEditForm() {
$this->baseEntityType->setLinkTemplate('edit-form', '/entity_test/{entity_test}/edit');
$data = $this->viewsData->getViewsData();
$this->assertFalse(isset($data['entity_test']['view_entity_test']));
$this->assertFalse(isset($data['entity_test']['delete_entity_test']));
$this->assertEquals('entity_link_edit', $data['entity_test']['edit_entity_test']['field']['id']);
foreach (['entity_test', 'entity_test_revision'] as $table_name) {
$this->assertFalse(isset($data[$table_name]['view_entity_test']));
$this->assertFalse(isset($data[$table_name]['delete_entity_test']));
$this->assertEquals('entity_link_edit', $data[$table_name]['edit_entity_test']['field']['id']);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment