diff --git a/lib/Drupal/views/Plugin/views/relationship/Broken.php b/lib/Drupal/views/Plugin/views/relationship/Broken.php new file mode 100644 index 00000000000..eb9f23f2bdd --- /dev/null +++ b/lib/Drupal/views/Plugin/views/relationship/Broken.php @@ -0,0 +1,43 @@ + '
' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '
', + ); + } + + /** + * Determine if the handler is considered 'broken' + */ + function broken() { return TRUE; } + +} diff --git a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php index a40b115e65f..4be407a96ea 100644 --- a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php +++ b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php @@ -169,30 +169,6 @@ class RelationshipPluginBase extends Handler { } } -/** - * A special handler to take the place of missing or broken handlers. - * - * @ingroup views_relationship_handlers - */ -class views_handler_relationship_broken extends RelationshipPluginBase { - function ui_name($short = FALSE) { - return t('Broken/missing handler'); - } - - function ensure_my_table() { /* No table to ensure! */ } - function query() { /* No query to run */ } - function options_form(&$form, &$form_state) { - $form['markup'] = array( - '#markup' => '
' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '
', - ); - } - - /** - * Determine if the handler is considered 'broken' - */ - function broken() { return TRUE; } -} - /** * @} */ diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index fdd6c235798..9bbe4971833 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -670,10 +670,10 @@ abstract class WizardPluginBase implements WizardInterface { } } $table_data = views_fetch_data($table); - // Check whether the bundle key filter handler is or an child of it views_handler_filter_in_operator + // Check whether the bundle key filter handler is or an child of it in_operator // If it's not just use a single value instead of an array. - $handler = $table_data[$bundle_key]['filter']['handler']; - if ($handler == 'views_handler_filter_in_operator' || is_subclass_of($handler, 'views_handler_filter_in_operator')) { + $handler = $table_data[$bundle_key]['filter']['plugin_id']; + if ($handler == 'in_operator' || is_subclass_of($handler, 'in_operator')) { $value = drupal_map_assoc(array($form_state['values']['show']['type'])); } else { diff --git a/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php b/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php index f3b0da5c3c5..dd5ad33d5fd 100644 --- a/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php +++ b/lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php @@ -10,20 +10,20 @@ namespace Drupal\views\Tests\Handler; use Drupal\views\Tests\ViewsSqlTest; /** - * Tests the core views_handler_filter_in_operator handler. + * Tests the core in_operator handler. */ class FilterInOperatorTest extends ViewsSqlTest { public static function getInfo() { return array( 'name' => 'Filter: in_operator', - 'description' => 'Test the core views_handler_filter_in_operator handler.', + 'description' => 'Test the core in_operator handler.', 'group' => 'Views Handlers', ); } function viewsData() { $data = parent::viewsData(); - $data['views_test']['age']['filter']['handler'] = 'views_handler_filter_in_operator'; + $data['views_test']['age']['filter']['handler'] = 'in_operator'; return $data; } diff --git a/lib/Views/user/Plugin/views/argument_default/CurrentUser.php b/lib/Views/user/Plugin/views/argument_default/CurrentUser.php index c52c5aca0f4..52ae8b3a47a 100644 --- a/lib/Views/user/Plugin/views/argument_default/CurrentUser.php +++ b/lib/Views/user/Plugin/views/argument_default/CurrentUser.php @@ -18,7 +18,7 @@ use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; * * @Plugin( * plugin_id = "current_user", - * title = @Translation("User ID from logged in user"), + * title = @Translation("User ID from logged in user") * ) */ class CurrentUser extends ArgumentDefaultPluginBase { diff --git a/lib/Views/user/Plugin/views/argument_default/User.php b/lib/Views/user/Plugin/views/argument_default/User.php index 55e8b6daa4d..e38bd264b63 100644 --- a/lib/Views/user/Plugin/views/argument_default/User.php +++ b/lib/Views/user/Plugin/views/argument_default/User.php @@ -16,7 +16,7 @@ use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; * * @Plugin( * plugin_id = "user", - * title = @Translation("User ID from URL"), + * title = @Translation("User ID from URL") * ) */ class User extends ArgumentDefaultPluginBase { diff --git a/lib/Views/user/Plugin/views/argument_validator/User.php b/lib/Views/user/Plugin/views/argument_validator/User.php index 3cbca124e9e..da295fb538e 100644 --- a/lib/Views/user/Plugin/views/argument_validator/User.php +++ b/lib/Views/user/Plugin/views/argument_validator/User.php @@ -20,7 +20,7 @@ use Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase; * * @Plugin( * plugin_id = "user", - * title = @Translation("User"), + * title = @Translation("User") * ) */ class User extends ArgumentValidatorPluginBase { diff --git a/modules/comment.views.inc b/modules/comment.views.inc index b451dc8567c..f747db86583 100644 --- a/modules/comment.views.inc +++ b/modules/comment.views.inc @@ -213,7 +213,7 @@ function comment_views_data() { 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_fulldate', + 'plugin_id' => 'node_created_fulldate', ), ); @@ -223,7 +223,7 @@ function comment_views_data() { 'help' => t('Date in the form of YYYYMM.'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_year_month', + 'plugin_id' => 'node_created_year_month', ), ); @@ -233,7 +233,7 @@ function comment_views_data() { 'help' => t('Date in the form of YYYY.'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_year', + 'plugin_id' => 'node_created_year', ), ); @@ -243,7 +243,7 @@ function comment_views_data() { 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_month', + 'plugin_id' => 'node_created_month', ), ); @@ -253,7 +253,7 @@ function comment_views_data() { 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_day', + 'plugin_id' => 'node_created_day', ), ); @@ -263,7 +263,7 @@ function comment_views_data() { 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array( 'field' => 'changed', - 'handler' => 'views_handler_argument_node_created_week', + 'plugin_id' => 'node_created_week', ), ); @@ -387,7 +387,7 @@ function comment_views_data() { 'plugin_id' => 'numeric', ), 'field' => array( - 'handler' => 'views_handler_field_user', + 'plugin_id' => 'user', ), ); diff --git a/modules/file.views.inc b/modules/file.views.inc index 394ebf00406..df8bebe8038 100644 --- a/modules/file.views.inc +++ b/modules/file.views.inc @@ -50,7 +50,7 @@ function file_field_views_data_views_data_alter(&$data, $field) { $data['file_managed'][$pseudo_field_name]['relationship'] = array( 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)), 'help' => t('Relate each @entity with a @field set to the file.', array('@entity' => $entity, '@field' => $label)), - 'handler' => 'views_handler_relationship_entity_reverse', + 'plugin_id' => 'entity_reverse', 'field_name' => $field['field_name'], 'field table' => _field_sql_storage_tablename($field), 'field field' => $field['field_name'] . '_fid', diff --git a/modules/image.views.inc b/modules/image.views.inc index ef7876e2ad1..09c6b3772d9 100644 --- a/modules/image.views.inc +++ b/modules/image.views.inc @@ -49,7 +49,7 @@ function image_field_views_data_views_data_alter(&$data, $field) { $data['file_managed'][$pseudo_field_name]['relationship'] = array( 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)), 'help' => t('Relate each @entity with a @field set to the image.', array('@entity' => $entity, '@field' => $label)), - 'handler' => 'views_handler_relationship_entity_reverse', + 'plugin_id' => 'entity_reverse', 'field_name' => $field['field_name'], 'field table' => _field_sql_storage_tablename($field), 'field field' => $field['field_name'] . '_fid', diff --git a/modules/statistics.views.inc b/modules/statistics.views.inc index 0a9cd39fff4..af0b707b3db 100644 --- a/modules/statistics.views.inc +++ b/modules/statistics.views.inc @@ -146,7 +146,7 @@ function statistics_views_data() { 'help' => t('Title of page visited.'), 'field' => array( - 'handler' => 'views_handler_field_accesslog_path', + 'plugin_id' => 'statistics_accesslog_path', 'click sortable' => TRUE, ), 'filter' => array( @@ -166,7 +166,7 @@ function statistics_views_data() { 'help' => t('Internal path to page visited (relative to Drupal root.)'), 'field' => array( - 'handler' => 'views_handler_field_accesslog_path', + 'plugin_id' => 'statistics_accesslog_path', 'click sortable' => TRUE, ), 'filter' => array(