-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #3143316 by Lendude, sunset_bill, alexpott, daffie, xjm, facine…
…: "Getting the base fields is not supported for entity type" exception in ViewsConfigUpdater
- Loading branch information
Showing
6 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
.../tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
views_config_entity_test.type.*: | ||
type: config_entity | ||
label: 'Config entity type with Views data' | ||
mapping: | ||
id: | ||
type: string | ||
name: | ||
type: label | ||
label: 'Name' |
26 changes: 26 additions & 0 deletions
26
modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Drupal\views_config_entity_test\Entity; | ||
|
||
use Drupal\Core\Config\Entity\ConfigEntityBase; | ||
|
||
/** | ||
* Defines a configuration-based entity type used for testing Views data. | ||
* | ||
* @ConfigEntityType( | ||
* id = "views_config_entity_test", | ||
* label = @Translation("Test config entity type with Views data"), | ||
* handlers = { | ||
* "list_builder" = "Drupal\Core\Entity\EntityListBuilder", | ||
* "views_data" = "Drupal\views_config_entity_test\ViewsConfigEntityTestViewsData" | ||
* }, | ||
* admin_permission = "administer modules", | ||
* config_prefix = "type", | ||
* entity_keys = { | ||
* "id" = "id", | ||
* "label" = "name" | ||
* } | ||
* ) | ||
*/ | ||
class ViewsConfigEntityTest extends ConfigEntityBase { | ||
} |
27 changes: 27 additions & 0 deletions
27
modules/views/tests/modules/views_config_entity_test/src/ViewsConfigEntityTestViewsData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Drupal\views_config_entity_test; | ||
|
||
use Drupal\Core\Entity\EntityTypeInterface; | ||
use Drupal\views\EntityViewsDataInterface; | ||
|
||
/** | ||
* Provides a view to override views data for config test entity types. | ||
*/ | ||
class ViewsConfigEntityTestViewsData implements EntityViewsDataInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getViewsData() { | ||
return []; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getViewsTableForEntityType(EntityTypeInterface $entity_type) { | ||
return 'views_config_entity_test'; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
modules/views/tests/modules/views_config_entity_test/views_config_entity_test.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: 'views_config_entity_test' | ||
description: 'Adds a Config Entity with views data' | ||
type: module | ||
package: Testing | ||
version: VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters