Issue #1787270 by damiankloip | dawehner: Fixed Split up default views into one per module.
parent
111e9b8067
commit
ec25fec7ea
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: node
|
||||||
name: archive
|
name: archive
|
||||||
description: 'Display a list of months that link to content for that month.'
|
description: 'Display a list of months that link to content for that month.'
|
||||||
tag: default
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: search
|
||||||
name: backlinks
|
name: backlinks
|
||||||
description: 'Displays a list of nodes that link to the node, using the search backlinks table.'
|
description: 'Displays a list of nodes that link to the node, using the search backlinks table.'
|
||||||
tag: default
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: comment
|
||||||
name: comments_recent
|
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.'
|
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
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: node
|
||||||
name: frontpage
|
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.'
|
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
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: node
|
||||||
name: glossary
|
name: glossary
|
||||||
description: 'A list of all content, by letter.'
|
description: 'A list of all content, by letter.'
|
||||||
tag: default
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: taxonomy
|
||||||
name: taxonomy_term
|
name: taxonomy_term
|
||||||
description: 'A view to emulate Drupal core''s handling of taxonomy/term.'
|
description: 'A view to emulate Drupal core''s handling of taxonomy/term.'
|
||||||
tag: default
|
tag: default
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
disabled: true
|
disabled: true
|
||||||
api_version: '3.0'
|
api_version: '3.0'
|
||||||
|
module: node
|
||||||
name: tracker
|
name: tracker
|
||||||
description: 'Shows all new activity on system.'
|
description: 'Shows all new activity on system.'
|
||||||
tag: default
|
tag: default
|
||||||
|
|
|
@ -26,6 +26,7 @@ class ViewStorageTest extends WebTestBase {
|
||||||
protected $config_properties = array(
|
protected $config_properties = array(
|
||||||
'disabled',
|
'disabled',
|
||||||
'api_version',
|
'api_version',
|
||||||
|
'module',
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
'tag',
|
'tag',
|
||||||
|
@ -54,7 +55,7 @@ class ViewStorageTest extends WebTestBase {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $modules = array('views');
|
public static $modules = array('views', 'node', 'search', 'comment', 'taxonomy');
|
||||||
|
|
||||||
public static function getInfo() {
|
public static function getInfo() {
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -118,6 +118,13 @@ class ViewStorage extends ConfigEntityBase implements ViewStorageInterface {
|
||||||
*/
|
*/
|
||||||
public $original;
|
public $original;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The module implementing this view.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $module = 'views';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the executable version of this view.
|
* 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().
|
* Overrides Drupal\Core\Entity\EntityInterface::id().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,6 +23,21 @@ class ViewStorageController extends ConfigStorageController {
|
||||||
*/
|
*/
|
||||||
protected $uuidFactory = NULL;
|
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();
|
* Overrides Drupal\config\ConfigStorageController::attachLoad();
|
||||||
*/
|
*/
|
||||||
|
@ -80,6 +95,7 @@ class ViewStorageController extends ConfigStorageController {
|
||||||
'core',
|
'core',
|
||||||
'display',
|
'display',
|
||||||
'uuid',
|
'uuid',
|
||||||
|
'module',
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($config_properties as $property) {
|
foreach ($config_properties as $property) {
|
||||||
|
|
Loading…
Reference in New Issue