Skip to content
Snippets Groups Projects
Verified Commit 77ccadfb authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3426961 by sorlov, Ruturaj Chaubey, mstrelan, smustgrave: Convert...

Issue #3426961 by sorlov, Ruturaj Chaubey, mstrelan, smustgrave: Convert ViewsSort plugin discovery to attributes
parent ad704a35
No related branches found
No related tags found
29 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!7526Expose roles in response,!7352Draft: Resolve #3203489 "Set filename as",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #123962 canceled
Showing
with 42 additions and 24 deletions
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort; namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase; use Drupal\views\Plugin\views\sort\SortPluginBase;
/** /**
* Sort handler, sorts by last comment name which can be in 2 different fields. * Sort handler, sorts by last comment name which can be in 2 different fields.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("comment_ces_last_comment_name")
*/ */
#[ViewsSort("comment_ces_last_comment_name")]
class StatisticsLastCommentName extends SortPluginBase { class StatisticsLastCommentName extends SortPluginBase {
/** /**
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort; namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\Date; use Drupal\views\Plugin\views\sort\Date;
/** /**
* Sort handler for the newer of last comment / entity updated. * Sort handler for the newer of last comment / entity updated.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("comment_ces_last_updated")
*/ */
#[ViewsSort("comment_ces_last_updated")]
class StatisticsLastUpdated extends Date { class StatisticsLastUpdated extends Date {
/** /**
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort; namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase; use Drupal\views\Plugin\views\sort\SortPluginBase;
/** /**
* Sort handler for ordering by thread. * Sort handler for ordering by thread.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("comment_thread")
*/ */
#[ViewsSort("comment_thread")]
class Thread extends SortPluginBase { class Thread extends SortPluginBase {
public function query() { public function query() {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\content_moderation\Plugin\views\ModerationStateJoinViewsHandlerTrait; use Drupal\content_moderation\Plugin\views\ModerationStateJoinViewsHandlerTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase; use Drupal\views\Plugin\views\sort\SortPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -11,9 +12,8 @@ ...@@ -11,9 +12,8 @@
* Enables sorting for the computed moderation_state field. * Enables sorting for the computed moderation_state field.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("moderation_state_sort")
*/ */
#[ViewsSort("moderation_state_sort")]
class ModerationStateSort extends SortPluginBase { class ModerationStateSort extends SortPluginBase {
use ModerationStateJoinViewsHandlerTrait; use ModerationStateJoinViewsHandlerTrait;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\datetime\Plugin\views\sort; namespace Drupal\datetime\Plugin\views\sort;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem; use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\FieldAPIHandlerTrait; use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\sort\Date as NumericDate; use Drupal\views\Plugin\views\sort\Date as NumericDate;
...@@ -11,9 +12,8 @@ ...@@ -11,9 +12,8 @@
* *
* This handler enables granularity, which is the ability to make dates * This handler enables granularity, which is the ability to make dates
* equivalent based upon nearness. * equivalent based upon nearness.
*
* @ViewsSort("datetime")
*/ */
#[ViewsSort("datetime")]
class Date extends NumericDate { class Date extends NumericDate {
use FieldAPIHandlerTrait; use FieldAPIHandlerTrait;
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
namespace Drupal\search\Plugin\views\sort; namespace Drupal\search\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase; use Drupal\views\Plugin\views\sort\SortPluginBase;
/** /**
* Sort handler for sorting by search score. * Sort handler for sorting by search score.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("search_score")
*/ */
#[ViewsSort("search_score")]
class Score extends SortPluginBase { class Score extends SortPluginBase {
/** /**
......
<?php
namespace Drupal\views\Attribute;
use Drupal\Component\Plugin\Attribute\PluginID;
/**
* Defines a Plugin attribute object for views sort handlers.
*
* @see \Drupal\views\Plugin\views\sort\SortPluginBase
*
* @ingroup views_sort_handlers
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class ViewsSort extends PluginID {
}
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
namespace Drupal\views\Plugin\views\sort; namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\BrokenHandlerTrait; use Drupal\views\Plugin\views\BrokenHandlerTrait;
/** /**
* A special handler to take the place of missing or broken handlers. * A special handler to take the place of missing or broken handlers.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("broken")
*/ */
#[ViewsSort("broken")]
class Broken extends SortPluginBase { class Broken extends SortPluginBase {
use BrokenHandlerTrait; use BrokenHandlerTrait;
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
namespace Drupal\views\Plugin\views\sort; namespace Drupal\views\Plugin\views\sort;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Attribute\ViewsSort;
/** /**
* Basic sort handler for dates. * Basic sort handler for dates.
* *
* This handler enables granularity, which is the ability to make dates * This handler enables granularity, which is the ability to make dates
* equivalent based upon nearness. * equivalent based upon nearness.
*
* @ViewsSort("date")
*/ */
#[ViewsSort("date")]
class Date extends SortPluginBase { class Date extends SortPluginBase {
protected function defineOptions() { protected function defineOptions() {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Drupal\views\Plugin\views\sort; namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\HandlerBase; use Drupal\views\Plugin\views\HandlerBase;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
...@@ -9,9 +10,8 @@ ...@@ -9,9 +10,8 @@
/** /**
* Handler for GROUP BY on simple numeric fields. * Handler for GROUP BY on simple numeric fields.
*
* @ViewsSort("groupby_numeric")
*/ */
#[ViewsSort("groupby_numeric")]
class GroupByNumeric extends SortPluginBase { class GroupByNumeric extends SortPluginBase {
/** /**
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Cache\UncacheableDependencyTrait; use Drupal\Core\Cache\UncacheableDependencyTrait;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Attribute\ViewsSort;
/** /**
* Handle a random sort. * Handle a random sort.
*
* @ViewsSort("random")
*/ */
#[ViewsSort("random")]
class Random extends SortPluginBase implements CacheableDependencyInterface { class Random extends SortPluginBase implements CacheableDependencyInterface {
use UncacheableDependencyTrait; use UncacheableDependencyTrait;
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* Plugins that handle sorting for Views. * Plugins that handle sorting for Views.
* *
* Sort handlers extend \Drupal\views\Plugin\views\sort:SortPluginBase. They * Sort handlers extend \Drupal\views\Plugin\views\sort:SortPluginBase. They
* must be annotated with \Drupal\views\Annotation\ViewsSort annotation, and * must be attributed with the \Drupal\views\Attribute\ViewsSort attribute,
* they must be in plugin directory Plugin\views\sort. * and they must be in plugin directory Plugin\views\sort.
* *
* @ingroup views_plugins * @ingroup views_plugins
* @see plugin_api * @see plugin_api
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
namespace Drupal\views\Plugin\views\sort; namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
/** /**
* Default implementation of the base sort plugin. * Default implementation of the base sort plugin.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*
* @ViewsSort("standard")
*/ */
#[ViewsSort("standard")]
class Standard extends SortPluginBase { class Standard extends SortPluginBase {
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment