Issue #1787270 by damiankloip | dawehner: Fixed Split up default views into one per module.
parent
111e9b8067
commit
ec25fec7ea
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: node
|
||||
name: archive
|
||||
description: 'Display a list of months that link to content for that month.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: search
|
||||
name: backlinks
|
||||
description: 'Displays a list of nodes that link to the node, using the search backlinks table.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: comment
|
||||
name: comments_recent
|
||||
description: 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: node
|
||||
name: frontpage
|
||||
description: 'Emulates the default Drupal front page; you may set the default home page path to this view to make it your front page.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: node
|
||||
name: glossary
|
||||
description: 'A list of all content, by letter.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: taxonomy
|
||||
name: taxonomy_term
|
||||
description: 'A view to emulate Drupal core''s handling of taxonomy/term.'
|
||||
tag: default
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
disabled: true
|
||||
api_version: '3.0'
|
||||
module: node
|
||||
name: tracker
|
||||
description: 'Shows all new activity on system.'
|
||||
tag: default
|
||||
|
|
|
@ -26,6 +26,7 @@ class ViewStorageTest extends WebTestBase {
|
|||
protected $config_properties = array(
|
||||
'disabled',
|
||||
'api_version',
|
||||
'module',
|
||||
'name',
|
||||
'description',
|
||||
'tag',
|
||||
|
@ -54,7 +55,7 @@ class ViewStorageTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('views');
|
||||
public static $modules = array('views', 'node', 'search', 'comment', 'taxonomy');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
|
|
|
@ -118,6 +118,13 @@ class ViewStorage extends ConfigEntityBase implements ViewStorageInterface {
|
|||
*/
|
||||
public $original;
|
||||
|
||||
/**
|
||||
* The module implementing this view.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $module = 'views';
|
||||
|
||||
/**
|
||||
* Stores the executable version of this view.
|
||||
*
|
||||
|
@ -184,6 +191,13 @@ class ViewStorage extends ConfigEntityBase implements ViewStorageInterface {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the module implementing this view.
|
||||
*/
|
||||
public function getModule() {
|
||||
return $this->module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,21 @@ class ViewStorageController extends ConfigStorageController {
|
|||
*/
|
||||
protected $uuidFactory = NULL;
|
||||
|
||||
/**
|
||||
* Overrides Drupal\config\ConfigStorageController::load();
|
||||
*/
|
||||
public function load(array $ids = NULL) {
|
||||
$entities = parent::load($ids);
|
||||
|
||||
// Only return views for enabled modules.
|
||||
return array_filter($entities, function ($entity) {
|
||||
if (module_exists($entity->getModule())) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\config\ConfigStorageController::attachLoad();
|
||||
*/
|
||||
|
@ -80,6 +95,7 @@ class ViewStorageController extends ConfigStorageController {
|
|||
'core',
|
||||
'display',
|
||||
'uuid',
|
||||
'module',
|
||||
);
|
||||
|
||||
foreach ($config_properties as $property) {
|
||||
|
|
Loading…
Reference in New Issue