Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3485117
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3485117
Commits
b93c8e0e
Commit
b93c8e0e
authored
12 years ago
by
Daniel Wehner
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Provide a sane default for the displays.
parent
4ed293f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Drupal/views/ViewStorageController.php
+10
-0
10 additions, 0 deletions
lib/Drupal/views/ViewStorageController.php
views.module
+1
-3
1 addition, 3 deletions
views.module
with
11 additions
and
3 deletions
lib/Drupal/views/ViewStorageController.php
+
10
−
0
View file @
b93c8e0e
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
views.module
+
1
−
3
View file @
b93c8e0e
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment