Commit 1a620291 authored by webchick's avatar webchick
Browse files

Issue #1893906 by damiankloip, dawehner: Fixed Move views argument date handlers from node module.

parent 81b76eab
......@@ -179,7 +179,7 @@ function comment_views_data() {
'help' => t('Date in the form of CCYYMMDD.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_fulldate',
'id' => 'date_fulldate',
),
);
......@@ -188,7 +188,7 @@ function comment_views_data() {
'help' => t('Date in the form of YYYYMM.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_year_month',
'id' => 'date_year_month',
),
);
......@@ -197,7 +197,7 @@ function comment_views_data() {
'help' => t('Date in the form of YYYY.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_year',
'id' => 'date_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_created_month',
'id' => 'date_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_created_day',
'id' => 'date_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_created_week',
'id' => 'date_week',
),
);
......
......@@ -266,16 +266,16 @@ function node_views_data() {
'help' => t('Date in the form of CCYYMMDD.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_fulldate',
'id' => 'date_fulldate',
),
);
$data['node']['created_year_month'] = array(
$data['node']['date_year_month'] = array(
'title' => t('Created year + month'),
'help' => t('Date in the form of YYYYMM.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_year_month',
'id' => 'date_year_month',
),
);
......@@ -284,7 +284,7 @@ function node_views_data() {
'help' => t('Date in the form of YYYY.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_year',
'id' => 'date_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_created_month',
'id' => 'date_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_created_day',
'id' => 'date_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_created_week',
'id' => 'date_week',
),
);
......@@ -320,7 +320,7 @@ function node_views_data() {
'help' => t('Date in the form of CCYYMMDD.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_fulldate',
'id' => 'date_fulldate',
),
);
......@@ -329,7 +329,7 @@ function node_views_data() {
'help' => t('Date in the form of YYYYMM.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_year_month',
'id' => 'date_year_month',
),
);
......@@ -338,7 +338,7 @@ function node_views_data() {
'help' => t('Date in the form of YYYY.'),
'argument' => array(
'field' => 'changed',
'id' => 'node_created_year',
'id' => 'date_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_created_month',
'id' => 'date_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_created_day',
'id' => 'date_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_created_week',
'id' => 'date_week',
),
);
......
......@@ -170,7 +170,7 @@ function user_views_data() {
'help' => t('Date in the form of CCYYMMDD.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_fulldate',
'id' => 'date_fulldate',
),
);
......@@ -179,7 +179,7 @@ function user_views_data() {
'help' => t('Date in the form of YYYYMM.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_year_month',
'id' => 'date_year_month',
),
);
......@@ -188,7 +188,7 @@ function user_views_data() {
'help' => t('Date in the form of YYYY.'),
'argument' => array(
'field' => 'created',
'id' => 'node_created_year',
'id' => 'date_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_created_month',
'id' => 'date_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_created_day',
'id' => 'date_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_created_week',
'id' => 'date_week',
),
);
......
......@@ -100,7 +100,7 @@ display:
summary_options:
items_per_page: '30'
specify_validation: '1'
plugin_id: node_created_year_month
plugin_id: date_year_month
human_name: Archive
module: node
id: archive
......
......@@ -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_created_day",
* id = "date_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
......
......@@ -2,25 +2,24 @@
/**
* @file
* Definition of Drupal\node\Plugin\views\argument\CreatedFullDate.
* 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_created_fulldate",
* id = "date_fulldate",
* arg_format = "Ymd",
* format = "F j, Y",
* module = "node"
* module = "views"
* )
*/
class CreatedFullDate extends Date {
class FullDate extends Date {
/**
* Provide a link to the next level of the view
......
......@@ -2,25 +2,24 @@
/**
* @file
* Definition of Drupal\node\Plugin\views\argument\CreatedMonth.
* Contains \Drupal\views\Plugin\views\argument\MonthDate.
*/
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_created_month",
* id = "date_month",
* arg_format = "m",
* format = "F",
* module = "node"
* module = "views"
* )
*/
class CreatedMonth extends Date {
class MonthDate extends Date {
/**
* Provide a link to the next level of the view
......
......@@ -2,24 +2,23 @@
/**
* @file
* Definition of Drupal\node\Plugin\views\argument\CreatedWeek.
* Contains \Drupal\views\Plugin\views\argument\WeekDate.
*/
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_created_week",
* id = "date_week",
* arg_format = "W",
* module = "node"
* module = "views"
* )
*/
class CreatedWeek extends Date {
class WeekDate extends Date {
/**
* Provide a link to the next level of the view
......
......@@ -2,23 +2,22 @@
/**
* @file
* Definition of Drupal\node\Plugin\views\argument\CreatedYear.
* Contains \Drupal\views\Plugin\views\argument\YearDate.
*/
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_created_year",
* id = "date_year",
* arg_format = "Y",
* module = "node"
* module = "views"
* )
*/
class CreatedYear extends Date {
class YearDate extends Date {
}
......@@ -2,25 +2,24 @@
/**
* @file
* Definition of Drupal\node\Plugin\views\argument\CreatedYearMonth.
* Contains \Drupal\views\Plugin\views\argument\YearMonthDate.
*/
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_created_year_month",
* id = "date_year_month",
* format = "F Y",
* arg_format = "Ym",
* module = "node"
* module = "views"
* )
*/
class CreatedYearMonth extends Date {
class YearMonthDate extends Date {
/**
* Provide a link to the next level of the view
......
......@@ -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_created_fulldate',
'node_created_day',
'node_created_month',
'node_created_week',
'node_created_year',
'node_created_year_month',
'date_fulldate',
'date_day',
'date_month',
'date_week',
'date_year',
'date_year_month',
);
foreach ($date_plugins as $plugin_id) {
$data['views_test_data'][$plugin_id] = $data['views_test_data']['created'];
......
......@@ -11,11 +11,11 @@ display:
pager_options: '0'
sorts: '0'
arguments:
node_created_fulldate:
field: node_created_fulldate
id: node_created_fulldate
date_fulldate:
field: date_fulldate
id: date_fulldate
table: views_test_data
plugin_id: node_created_fulldate
plugin_id: date_fulldate
fields:
id:
field: id
......@@ -45,11 +45,11 @@ display:
defaults:
arguments: '0'
arguments:
node_created_day:
field: node_created_day
id: node_created_day
date_day:
field: date_day
id: date_day
table: views_test_data
plugin_id: node_created_day
plugin_id: date_day
display_plugin: embed
id: embed_1
embed_2:
......@@ -57,11 +57,11 @@ display:
defaults:
arguments: '0'
arguments:
node_created_month:
field: node_created_month
id: node_created_month
date_month:
field: date_month
id: date_month
table: views_test_data
plugin_id: node_created_month
plugin_id: date_month
display_plugin: embed
id: embed_2
embed_3:
......@@ -69,11 +69,11 @@ display:
defaults:
arguments: '0'
arguments:
node_created_week:
field: node_created_week
id: node_created_week
date_week:
field: date_week
id: date_week
table: views_test_data
plugin_id: node_created_week
plugin_id: date_week
display_plugin: embed
id: embed_3
embed_4:
......@@ -81,11 +81,11 @@ display:
defaults:
arguments: '0'
arguments:
node_created_year:
field: node_created_year
id: node_created_year
date_year:
field: date_year
id: date_year
table: views_test_data
plugin_id: node_created_year
plugin_id: date_year
display_plugin: embed
id: embed_4
embed_5:
......@@ -93,11 +93,11 @@ display:
defaults:
arguments: '0'
arguments:
node_created_year_month:
field: node_created_year_month
id: node_created_year_month
date_year_month:
field: date_year_month
id: date_year_month
table: views_test_data
plugin_id: node_created_year_month
plugin_id: date_year_month
display_plugin: embed
id: embed_5
human_name: ''
......
......@@ -36,21 +36,21 @@ display:
id: created_day
style_plugin: default_summary
table: node
plugin_id: node_created_day
plugin_id: date_day
created_fulldate:
default_argument_type: fixed
field: created_fulldate
id: created_fulldate
style_plugin: default_summary
table: node
plugin_id: node_created_fulldate
plugin_id: date_fulldate
created_month:
default_argument_type: fixed
field: created_month
id: created_month
style_plugin: default_summary
table: node
plugin_id: node_created_month
plugin_id: date_month
cache:
type: none
empty:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment