Skip to content
Snippets Groups Projects
Verified Commit e4791b43 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

(cherry picked from commit 77ccadfb)
parent 9ee61322
No related branches found
No related tags found
25 merge requests!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #123959 canceled
Showing
with 42 additions and 24 deletions
......@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
/**
* Sort handler, sorts by last comment name which can be in 2 different fields.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("comment_ces_last_comment_name")
*/
#[ViewsSort("comment_ces_last_comment_name")]
class StatisticsLastCommentName extends SortPluginBase {
/**
......
......@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\Date;
/**
* Sort handler for the newer of last comment / entity updated.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("comment_ces_last_updated")
*/
#[ViewsSort("comment_ces_last_updated")]
class StatisticsLastUpdated extends Date {
/**
......
......@@ -2,15 +2,15 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
/**
* Sort handler for ordering by thread.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("comment_thread")
*/
#[ViewsSort("comment_thread")]
class Thread extends SortPluginBase {
public function query() {
......
......@@ -4,6 +4,7 @@
use Drupal\content_moderation\Plugin\views\ModerationStateJoinViewsHandlerTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -11,9 +12,8 @@
* Enables sorting for the computed moderation_state field.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("moderation_state_sort")
*/
#[ViewsSort("moderation_state_sort")]
class ModerationStateSort extends SortPluginBase {
use ModerationStateJoinViewsHandlerTrait;
......
......@@ -3,6 +3,7 @@
namespace Drupal\datetime\Plugin\views\sort;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\sort\Date as NumericDate;
......@@ -11,9 +12,8 @@
*
* This handler enables granularity, which is the ability to make dates
* equivalent based upon nearness.
*
* @ViewsSort("datetime")
*/
#[ViewsSort("datetime")]
class Date extends NumericDate {
use FieldAPIHandlerTrait;
......
......@@ -2,15 +2,15 @@
namespace Drupal\search\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
/**
* Sort handler for sorting by search score.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("search_score")
*/
#[ViewsSort("search_score")]
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 @@
namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\BrokenHandlerTrait;
/**
* A special handler to take the place of missing or broken handlers.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("broken")
*/
#[ViewsSort("broken")]
class Broken extends SortPluginBase {
use BrokenHandlerTrait;
......
......@@ -3,15 +3,15 @@
namespace Drupal\views\Plugin\views\sort;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Attribute\ViewsSort;
/**
* Basic sort handler for dates.
*
* This handler enables granularity, which is the ability to make dates
* equivalent based upon nearness.
*
* @ViewsSort("date")
*/
#[ViewsSort("date")]
class Date extends SortPluginBase {
protected function defineOptions() {
......
......@@ -2,6 +2,7 @@
namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\HandlerBase;
use Drupal\views\ViewExecutable;
......@@ -9,9 +10,8 @@
/**
* Handler for GROUP BY on simple numeric fields.
*
* @ViewsSort("groupby_numeric")
*/
#[ViewsSort("groupby_numeric")]
class GroupByNumeric extends SortPluginBase {
/**
......
......@@ -5,12 +5,12 @@
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Cache\UncacheableDependencyTrait;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Attribute\ViewsSort;
/**
* Handle a random sort.
*
* @ViewsSort("random")
*/
#[ViewsSort("random")]
class Random extends SortPluginBase implements CacheableDependencyInterface {
use UncacheableDependencyTrait;
......
......@@ -13,8 +13,8 @@
* Plugins that handle sorting for Views.
*
* Sort handlers extend \Drupal\views\Plugin\views\sort:SortPluginBase. They
* must be annotated with \Drupal\views\Annotation\ViewsSort annotation, and
* they must be in plugin directory Plugin\views\sort.
* must be attributed with the \Drupal\views\Attribute\ViewsSort attribute,
* and they must be in plugin directory Plugin\views\sort.
*
* @ingroup views_plugins
* @see plugin_api
......
......@@ -2,13 +2,14 @@
namespace Drupal\views\Plugin\views\sort;
use Drupal\views\Attribute\ViewsSort;
/**
* Default implementation of the base sort plugin.
*
* @ingroup views_sort_handlers
*
* @ViewsSort("standard")
*/
#[ViewsSort("standard")]
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