Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
1a620291
Commit
1a620291
authored
Mar 26, 2013
by
Angie Byron
Browse files
Issue
#1893906
by damiankloip, dawehner: Fixed Move views argument date handlers from node module.
parent
81b76eab
Changes
13
Hide whitespace changes
Inline
Side-by-side
core/modules/comment/comment.views.inc
View file @
1a620291
...
...
@@ -179,7 +179,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of CCYYMMDD.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_fulldate'
,
'id'
=>
'
d
ate_fulldate'
,
),
);
...
...
@@ -188,7 +188,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of YYYYMM.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_year_month'
,
'id'
=>
'
d
ate_year_month'
,
),
);
...
...
@@ -197,7 +197,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of YYYY.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_year'
,
'id'
=>
'
d
ate_year'
,
),
);
...
...
@@ -206,7 +206,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of MM (01 - 12).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_month'
,
'id'
=>
'
d
ate_month'
,
),
);
...
...
@@ -215,7 +215,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of DD (01 - 31).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_day'
,
'id'
=>
'
d
ate_day'
,
),
);
...
...
@@ -224,7 +224,7 @@ function comment_views_data() {
'help'
=>
t
(
'Date in the form of WW (01 - 53).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_week'
,
'id'
=>
'
d
ate_week'
,
),
);
...
...
core/modules/node/node.views.inc
View file @
1a620291
...
...
@@ -266,16 +266,16 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of CCYYMMDD.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_fulldate'
,
'id'
=>
'
d
ate_fulldate'
,
),
);
$data
[
'node'
][
'
cre
ate
d
_year_month'
]
=
array
(
$data
[
'node'
][
'
d
ate_year_month'
]
=
array
(
'title'
=>
t
(
'Created year + month'
),
'help'
=>
t
(
'Date in the form of YYYYMM.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_year_month'
,
'id'
=>
'
d
ate_year_month'
,
),
);
...
...
@@ -284,7 +284,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of YYYY.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_year'
,
'id'
=>
'
d
ate_year'
,
),
);
...
...
@@ -293,7 +293,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of MM (01 - 12).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_month'
,
'id'
=>
'
d
ate_month'
,
),
);
...
...
@@ -302,7 +302,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of DD (01 - 31).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_day'
,
'id'
=>
'
d
ate_day'
,
),
);
...
...
@@ -311,7 +311,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of WW (01 - 53).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_week'
,
'id'
=>
'
d
ate_week'
,
),
);
...
...
@@ -320,7 +320,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of CCYYMMDD.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_fulldate'
,
'id'
=>
'
d
ate_fulldate'
,
),
);
...
...
@@ -329,7 +329,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of YYYYMM.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_year_month'
,
'id'
=>
'
d
ate_year_month'
,
),
);
...
...
@@ -338,7 +338,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of YYYY.'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_year'
,
'id'
=>
'
d
ate_year'
,
),
);
...
...
@@ -347,7 +347,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of MM (01 - 12).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_month'
,
'id'
=>
'
d
ate_month'
,
),
);
...
...
@@ -356,7 +356,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of DD (01 - 31).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_day'
,
'id'
=>
'
d
ate_day'
,
),
);
...
...
@@ -365,7 +365,7 @@ function node_views_data() {
'help'
=>
t
(
'Date in the form of WW (01 - 53).'
),
'argument'
=>
array
(
'field'
=>
'changed'
,
'id'
=>
'
node_cre
ate
d
_week'
,
'id'
=>
'
d
ate_week'
,
),
);
...
...
core/modules/user/user.views.inc
View file @
1a620291
...
...
@@ -170,7 +170,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of CCYYMMDD.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_fulldate'
,
'id'
=>
'
d
ate_fulldate'
,
),
);
...
...
@@ -179,7 +179,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of YYYYMM.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_year_month'
,
'id'
=>
'
d
ate_year_month'
,
),
);
...
...
@@ -188,7 +188,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of YYYY.'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_year'
,
'id'
=>
'
d
ate_year'
,
),
);
...
...
@@ -197,7 +197,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of MM (01 - 12).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_month'
,
'id'
=>
'
d
ate_month'
,
),
);
...
...
@@ -206,7 +206,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of DD (01 - 31).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_day'
,
'id'
=>
'
d
ate_day'
,
),
);
...
...
@@ -215,7 +215,7 @@ function user_views_data() {
'help'
=>
t
(
'Date in the form of WW (01 - 53).'
),
'argument'
=>
array
(
'field'
=>
'created'
,
'id'
=>
'
node_cre
ate
d
_week'
,
'id'
=>
'
d
ate_week'
,
),
);
...
...
core/modules/views/config/views.view.archive.yml
View file @
1a620291
...
...
@@ -100,7 +100,7 @@ display:
summary_options
:
items_per_page
:
'
30'
specify_validation
:
'
1'
plugin_id
:
node_cre
ate
d
_year_month
plugin_id
:
d
ate_year_month
human_name
:
Archive
module
:
node
id
:
archive
...
...
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
CreatedDay
.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/
DayDate
.php
View file @
1a620291
...
...
@@ -2,25 +2,24 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
CreatedDay
.
*
Contains \
Drupal\
views
\Plugin\views\argument\
DayDate
.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a day (DD)
*
* @Plugin(
* id = "
node_cre
ate
d
_day",
* id = "
d
ate_day",
* arg_format = "d",
* format = "j",
* module = "
node
"
* module = "
views
"
* )
*/
class
CreatedDay
extends
Date
{
class
DayDate
extends
Date
{
/**
* Provide a link to the next level of the view
...
...
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
Created
FullDate.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/FullDate.php
View file @
1a620291
...
...
@@ -2,25 +2,24 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
Created
FullDate.
*
Contains \
Drupal\
views
\Plugin\views\argument\FullDate.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a full date (CCYYMMDD)
*
* @Plugin(
* id = "
node_cre
ate
d
_fulldate",
* id = "
d
ate_fulldate",
* arg_format = "Ymd",
* format = "F j, Y",
* module = "
node
"
* module = "
views
"
* )
*/
class
Created
FullDate
extends
Date
{
class
FullDate
extends
Date
{
/**
* Provide a link to the next level of the view
...
...
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
Created
Month.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/Month
Date
.php
View file @
1a620291
...
...
@@ -2,25 +2,24 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
Created
Month.
*
Contains \
Drupal\
views
\Plugin\views\argument\Month
Date
.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a month (MM)
*
* @Plugin(
* id = "
node_cre
ate
d
_month",
* id = "
d
ate_month",
* arg_format = "m",
* format = "F",
* module = "
node
"
* module = "
views
"
* )
*/
class
Created
Month
extends
Date
{
class
Month
Date
extends
Date
{
/**
* Provide a link to the next level of the view
...
...
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
Created
Week.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/Week
Date
.php
View file @
1a620291
...
...
@@ -2,24 +2,23 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
Created
Week.
*
Contains \
Drupal\
views
\Plugin\views\argument\Week
Date
.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a week.
*
* @Plugin(
* id = "
node_cre
ate
d
_week",
* id = "
d
ate_week",
* arg_format = "W",
* module = "
node
"
* module = "
views
"
* )
*/
class
Created
Week
extends
Date
{
class
Week
Date
extends
Date
{
/**
* Provide a link to the next level of the view
...
...
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
Created
Year.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/Year
Date
.php
View file @
1a620291
...
...
@@ -2,23 +2,22 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
Created
Year.
*
Contains \
Drupal\
views
\Plugin\views\argument\Year
Date
.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a year (CCYY)
*
* @Plugin(
* id = "
node_cre
ate
d
_year",
* id = "
d
ate_year",
* arg_format = "Y",
* module = "
node
"
* module = "
views
"
* )
*/
class
Created
Year
extends
Date
{
class
Year
Date
extends
Date
{
}
core/modules/
node
/lib/Drupal/
node
/Plugin/views/argument/
Created
YearMonth.php
→
core/modules/
views
/lib/Drupal/
views
/Plugin/views/argument/YearMonth
Date
.php
View file @
1a620291
...
...
@@ -2,25 +2,24 @@
/**
* @file
*
Definition of
Drupal\
node
\Plugin\views\argument\
Created
YearMonth.
*
Contains \
Drupal\
views
\Plugin\views\argument\YearMonth
Date
.
*/
namespace
Drupal\
node
\Plugin\views\argument
;
namespace
Drupal\
views
\Plugin\views\argument
;
use
Drupal\Component\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Date
;
/**
* Argument handler for a year plus month (CCYYMM)
*
* @Plugin(
* id = "
node_cre
ate
d
_year_month",
* id = "
d
ate_year_month",
* format = "F Y",
* arg_format = "Ym",
* module = "
node
"
* module = "
views
"
* )
*/
class
Created
YearMonth
extends
Date
{
class
YearMonth
Date
extends
Date
{
/**
* Provide a link to the next level of the view
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/ArgumentDateTest.php
View file @
1a620291
...
...
@@ -23,15 +23,6 @@ class ArgumentDateTest extends ViewUnitTestBase {
*/
public
static
$testViews
=
array
(
'test_argument_date'
);
/**
* Modules to enable.
*
* @todo Remove the node dependency once the handlers are moved to views.
*
* @var array
*/
public
static
$modules
=
array
(
'node'
,
'user'
);
/**
* Stores the column map for this testCase.
*
...
...
@@ -49,13 +40,6 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
installSchema
(
'user'
,
'role_permission'
);
}
/**
* Overrides \Drupal\views\Tests\ViewUnitTestBase::viewsData().
*/
...
...
@@ -63,12 +47,12 @@ public function viewsData() {
$data
=
parent
::
viewsData
();
$date_plugins
=
array
(
'
node_cre
ate
d
_fulldate'
,
'
node_cre
ate
d
_day'
,
'
node_cre
ate
d
_month'
,
'
node_cre
ate
d
_week'
,
'
node_cre
ate
d
_year'
,
'
node_cre
ate
d
_year_month'
,
'
d
ate_fulldate'
,
'
d
ate_day'
,
'
d
ate_month'
,
'
d
ate_week'
,
'
d
ate_year'
,
'
d
ate_year_month'
,
);
foreach
(
$date_plugins
as
$plugin_id
)
{
$data
[
'views_test_data'
][
$plugin_id
]
=
$data
[
'views_test_data'
][
'created'
];
...
...
core/modules/views/tests/views_test_config/test_views/views.view.test_argument_date.yml
View file @
1a620291
...
...
@@ -11,11 +11,11 @@ display:
pager_options
:
'
0'
sorts
:
'
0'
arguments
:
node_cre
ate
d
_fulldate
:
field
:
node_cre
ate
d
_fulldate
id
:
node_cre
ate
d
_fulldate
d
ate_fulldate
:
field
:
d
ate_fulldate
id
:
d
ate_fulldate
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_fulldate
plugin_id
:
d
ate_fulldate
fields
:
id
:
field
:
id
...
...
@@ -45,11 +45,11 @@ display:
defaults
:
arguments
:
'
0'
arguments
:
node_cre
ate
d
_day
:
field
:
node_cre
ate
d
_day
id
:
node_cre
ate
d
_day
d
ate_day
:
field
:
d
ate_day
id
:
d
ate_day
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_day
plugin_id
:
d
ate_day
display_plugin
:
embed
id
:
embed_1
embed_2
:
...
...
@@ -57,11 +57,11 @@ display:
defaults
:
arguments
:
'
0'
arguments
:
node_cre
ate
d
_month
:
field
:
node_cre
ate
d
_month
id
:
node_cre
ate
d
_month
d
ate_month
:
field
:
d
ate_month
id
:
d
ate_month
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_month
plugin_id
:
d
ate_month
display_plugin
:
embed
id
:
embed_2
embed_3
:
...
...
@@ -69,11 +69,11 @@ display:
defaults
:
arguments
:
'
0'
arguments
:
node_cre
ate
d
_week
:
field
:
node_cre
ate
d
_week
id
:
node_cre
ate
d
_week
d
ate_week
:
field
:
d
ate_week
id
:
d
ate_week
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_week
plugin_id
:
d
ate_week
display_plugin
:
embed
id
:
embed_3
embed_4
:
...
...
@@ -81,11 +81,11 @@ display:
defaults
:
arguments
:
'
0'
arguments
:
node_cre
ate
d
_year
:
field
:
node_cre
ate
d
_year
id
:
node_cre
ate
d
_year
d
ate_year
:
field
:
d
ate_year
id
:
d
ate_year
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_year
plugin_id
:
d
ate_year
display_plugin
:
embed
id
:
embed_4
embed_5
:
...
...
@@ -93,11 +93,11 @@ display:
defaults
:
arguments
:
'
0'
arguments
:
node_cre
ate
d
_year_month
:
field
:
node_cre
ate
d
_year_month
id
:
node_cre
ate
d
_year_month
d
ate_year_month
:
field
:
d
ate_year_month
id
:
d
ate_year_month
table
:
views_test_data
plugin_id
:
node_cre
ate
d
_year_month
plugin_id
:
d
ate_year_month
display_plugin
:
embed
id
:
embed_5
human_name
:
'
'
...
...
core/modules/views/tests/views_test_config/test_views/views.view.test_destroy.yml
View file @
1a620291
...
...
@@ -36,21 +36,21 @@ display:
id
:
created_day
style_plugin
:
default_summary
table
:
node
plugin_id
:
node_cre
ate
d
_day
plugin_id
:
d
ate_day
created_fulldate
:
default_argument_type
:
fixed
field
:
created_fulldate
id
:
created_fulldate
style_plugin
:
default_summary
table
:
node
plugin_id
:
node_cre
ate
d
_fulldate
plugin_id
:
d
ate_fulldate
created_month
:
default_argument_type
:
fixed
field
:
created_month
id
:
created_month
style_plugin
:
default_summary
table
:
node
plugin_id
:
node_cre
ate
d
_month
plugin_id
:
d
ate_month
cache
:
type
:
none
empty
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment