Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
872b4963
Commit
872b4963
authored
Jun 12, 2015
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2495073
by dawehner, catch: Views feed display plugin has to get all views data on init
parent
53c197a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
17 deletions
+25
-17
core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml
...ent_test_views/test_views/views.view.test_comment_rss.yml
+5
-0
core/modules/views/src/Plugin/views/display/Feed.php
core/modules/views/src/Plugin/views/display/Feed.php
+20
-17
No files found.
core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml
View file @
872b4963
...
...
@@ -72,3 +72,8 @@ display:
position
:
null
display_options
:
path
:
test-comment-rss
defaults
:
row
:
false
row
:
type
:
comment_rss
options
:
{}
core/modules/views/src/Plugin/views/display/Feed.php
View file @
872b4963
...
...
@@ -46,22 +46,6 @@ class Feed extends PathPluginBase implements ResponseDisplayPluginInterface {
*/
protected
$usesPager
=
FALSE
;
/**
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::initDisplay().
*/
public
function
initDisplay
(
ViewExecutable
$view
,
array
&
$display
,
array
&
$options
=
NULL
)
{
parent
::
initDisplay
(
$view
,
$display
,
$options
);
// Set the default row style. Ideally this would be part of the option
// definition, but in this case it's dependent on the view's base table,
// which we don't know until init().
$row_plugins
=
Views
::
fetchPluginNames
(
'row'
,
$this
->
getType
(),
array
(
$view
->
storage
->
get
(
'base_table'
)));
$default_row_plugin
=
key
(
$row_plugins
);
if
(
empty
(
$this
->
options
[
'row'
][
'type'
]))
{
$this
->
options
[
'row'
][
'type'
]
=
$default_row_plugin
;
}
}
/**
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::getType().
*/
...
...
@@ -166,13 +150,32 @@ protected function defineOptions() {
$options
[
'style'
][
'contains'
][
'type'
][
'default'
]
=
'rss'
;
$options
[
'style'
][
'contains'
][
'options'
][
'default'
]
=
array
(
'description'
=>
''
);
$options
[
'sitename_title'
][
'default'
]
=
FALSE
;
$options
[
'row'
][
'contains'
][
'type'
][
'default'
]
=
''
;
$options
[
'row'
][
'contains'
][
'type'
][
'default'
]
=
'
rss_fields
'
;
$options
[
'defaults'
][
'default'
][
'style'
]
=
FALSE
;
$options
[
'defaults'
][
'default'
][
'row'
]
=
FALSE
;
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
newDisplay
()
{
parent
::
newDisplay
();
// Set the default row style. Ideally this would be part of the option
// definition, but in this case it's dependent on the view's base table,
// which we don't know until init().
if
(
empty
(
$this
->
options
[
'row'
][
'type'
])
||
$this
->
options
[
'row'
][
'type'
]
===
'rss_fields'
)
{
$row_plugins
=
Views
::
fetchPluginNames
(
'row'
,
$this
->
getType
(),
array
(
$this
->
view
->
storage
->
get
(
'base_table'
)));
$default_row_plugin
=
key
(
$row_plugins
);
$options
=
$this
->
getOption
(
'row'
);
$options
[
'type'
]
=
$default_row_plugin
;
$this
->
setOption
(
'row'
,
$options
);
}
}
/**
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary().
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment