Skip to content
Snippets Groups Projects
Commit b93c8e0e authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Provide a sane default for the displays.

parent 4ed293f8
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,17 @@ public function save(StorableInterface $entity) {
* Overrides Drupal\config\ConfigStorageController::create().
*/
public function create(array $values) {
// If there is no information about displays available add at least the
// default display.
$values += array(
'display' => array(
'default' => array()
)
);
$entity = parent::create($values);
$this->attachDisplays($entity);
return $entity;
}
......
......@@ -1507,9 +1507,7 @@ function views_get_all_templates() {
* it can be successfully saved.
*/
function views_new_view() {
$view = new View();
$view->vid = 'new';
$view->add_display('default');
$view = entity_create('view', array());
return $view;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment