diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Condition.php b/core/lib/Drupal/Core/Config/Entity/Query/Condition.php index d231f0b..132ebc1 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/Condition.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/Condition.php @@ -162,6 +162,8 @@ protected function match(array $condition, $value) { return $value >= $condition['value']; case '<=': return $value <= $condition['value']; + case '<>': + return $value != $condition['value']; case 'IN': return array_search($value, $condition['value']) !== FALSE; case 'NOT IN': diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index d9fc159..d25e547 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -34,6 +34,11 @@ /** * Constructs a new FilterFormatFormControllerBase. + * + * @param \Drupal\Core\Config\ConfigFactory $config_factory + * The config factory. + * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory + * The entity query factory. */ public function __construct(ConfigFactory $config_factory, QueryFactory $query_factory) { $this->configFactory = $config_factory; @@ -199,6 +204,7 @@ public function validate(array $form, array &$form_state) { $format_exists = $this->queryFactory ->get('filter_format') + ->condition('format', $format_format, '<>') ->condition('name', $format_name) ->execute(); if ($format_exists) { diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php index b39887e..f7649b0 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php @@ -35,7 +35,18 @@ class FilterFormatListController extends ConfigEntityListController implements F protected $configFactory; /** - * {@inheritdoc} + * Constructs a new FilterFormatListController. + * + * @param string $entity_type + * The type of entity to be listed. + * @param array $entity_info + * An array of entity info for the entity type. + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage + * The entity storage controller class. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to invoke hooks on. + * @param \Drupal\Core\Config\ConfigFactory $config_factory + * The config factory. */ public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/ConfigEntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/ConfigEntityQueryTest.php index bfafc9e..9a84de9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/ConfigEntityQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/ConfigEntityQueryTest.php @@ -181,6 +181,12 @@ public function testConfigEntityQuery() { ->execute(); $this->assertResults(array('3', '4', '5')); + // Filter by ID with the <> operator. + $this->queryResults = $this->factory->get('config_query_test') + ->condition('id', '3', '<>') + ->execute(); + $this->assertResults(array('1', '2', '4', '5')); + // Filter by ID with the < operator. $this->queryResults = $this->factory->get('config_query_test') ->condition('id', '3', '<')