Problem/Motivation

Views uses the LIKE and the NOT LIKE SQL operators for filtering. The results are suppoost to be case in-sensitive. PostgreSQL uses the ILIKE and the NOT ILIKE SQL operators for case in-sensitive filtering.

Proposed resolution

Use the method Connection::mapConditionOperator() to the database driver specific SQL operator for filtering.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

CommentFileSizeAuthor
#91 2784739-91.patch18.38 KBdaffie
#91 interdiff-2784739-89-91.txt502 bytesdaffie
#89 2784739-89.patch18.37 KBdaffie
#89 2784739-89-tests-only.patch9.92 KBdaffie
#89 interdiff-2784739-86-89.txt2.76 KBdaffie
#86 2784739-86.patch18.21 KBdaffie
#86 interdiff-2784739-83-86.txt13.58 KBdaffie
#83 interdiff_80_83.txt1.59 KBanmolgoyal74
#83 2784739-83.patch5.27 KBanmolgoyal74
#80 2784739-80.patch5.4 KBsylvain lavielle
#74 2784739-74.patch5.7 KBkostyashupenko
#71 interdiff-2784739-68-71.patch4.37 KBvoleger
#71 2784739-71.patch7.33 KBvoleger
#68 interdiff-2784739-64-68.txt3.21 KBvoleger
#68 2784739-68.patch7.29 KBvoleger
#64 interdiff-2784739-59-64.txt2.14 KBMerryHamster
#64 2784739-64.patch10.54 KBMerryHamster
#59 interdiff-2784739-56-59.txt4.09 KBMerryHamster
#59 2784739-59.patch8.55 KBMerryHamster
#56 FixOperator-2784739-56.patch8.58 KBgawaksh
#46 2784739-46-D8.patch10.69 KBmohit1604
#40 2784739-40--replace_db_like.patch10.99 KBmiiimooo
#38 2784739-38--replace_db_like.patch10.77 KBmiiimooo
#35 2784739-replace-db-like-35-1.patch5.84 KBmiiimooo
#35 interdiff.txt5.84 KBmiiimooo
#28 replace-db-like_2784739_28.patch5.06 KBmeenakshig
#26 2784739-replace-db-like-26.patch10.71 KBJuterpillar
#22 interdiff.txt673 bytesslasher13
#22 replace-db-like-2784739-22.patch10.71 KBslasher13
#15 interdiff.txt9.36 KBslasher13
#15 replace-db-like-2784739-15.patch10.55 KBslasher13
#14 replace-db-like-2784739-14.patch8.19 KBslasher13
#10 interdiff.txt4.83 KBslasher13
#10 replace-db-like-2784739-10-8.2.x.patch8.32 KBslasher13
#9 replace-db-like-2784739-9-8.3.x.patch6.87 KBchanderbhushan
#6 replace-db-like-2784739-6-8.3.x.patch6.46 KBchanderbhushan
#3 replace-db-like-2784739-3-8.3.x.patch6.81 KBprashant.c

Comments

Lendude created an issue. See original summary.

lendude’s picture

Issue summary: View changes
prashant.c’s picture

StatusFileSize
new6.81 KB

Replacing occurrences of db_like with Database::getConnection()->escapeLike($string) in Views module.

prashant.c’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: replace-db-like-2784739-3-8.3.x.patch, failed testing.

chanderbhushan’s picture

Status: Needs work » Needs review
StatusFileSize
new6.46 KB

Submitting new patch

Status: Needs review » Needs work

The last submitted patch, 6: replace-db-like-2784739-6-8.3.x.patch, failed testing.

prashant.c’s picture

Patch #6 is applying successfully.

chanderbhushan’s picture

Status: Needs work » Needs review
StatusFileSize
new6.87 KB

Added my new patch

slasher13’s picture

Title: Replace db_like with Database::getConnection()->escapeLike($string) wherever possible in views » Fix PostgreSQL operator and replace db_like wherever possible in views
Version: 8.3.x-dev » 8.2.x-dev
Category: Task » Bug report
Issue summary: View changes
StatusFileSize
new8.32 KB
new4.83 KB
slasher13’s picture

Issue tags: +PostgreSQL
mradcliffe’s picture

+++ b/core/modules/views/src/Plugin/views/display/EntityReference.php
@@ -122,7 +124,7 @@ public function query() {
+      $value = Database::getConnection()->escapeLike($options['match']) . '%';

Wouldn't it be better to inject the database service into the plugin via ContainerFactoryPluginInterface?

Likewise for other instances. I'm not familiar with enough with views plugins to know if there is a significant performance impact to use the injection interface instead of tightly-coupling the Database class.

slasher13’s picture

StatusFileSize
new8.19 KB

re-roll

slasher13’s picture

StatusFileSize
new10.55 KB
new9.36 KB

addresses #13 except in EntityReference class because of special handling in DisplayPluginBase: parent::__construct(array(), $plugin_id, $plugin_definition)

The last submitted patch, 14: replace-db-like-2784739-14.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 15: replace-db-like-2784739-15.patch, failed testing.

The last submitted patch, 14: replace-db-like-2784739-14.patch, failed testing.

The last submitted patch, 15: replace-db-like-2784739-15.patch, failed testing.

slasher13’s picture

Status: Needs work » Needs review
lendude’s picture

Status: Needs review » Needs work

@slasher13, this is starting to look good! Couple of things I see:

  1. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -236,7 +275,20 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
       function operator() {
    -    return $this->operator == '=' ? 'LIKE' : 'NOT LIKE';
    +    return $this->getConditionOperator($this->operator == '=' ? 'LIKE' : 'NOT LIKE');
    

    Since we are updating the return value, maybe give this method a docblock to be able to reflect what we are returning now and a visibility while we are at it (for BC reasons probably public)

  2. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -283,7 +335,7 @@ protected function opContainsWord($field) {
    +        $where->condition($field, '%' . $this->connection->escapeLike(trim($word, " ,!?")) . '%', 'LIKE');
    
    @@ -297,23 +349,23 @@ protected function opContainsWord($field) {
    +    $this->query->addWhere($this->options['group'], $field, $this->connection->escapeLike($this->value) . '%', 'LIKE');
    ...
    +    $this->query->addWhere($this->options['group'], $field, $this->connection->escapeLike($this->value) . '%', 'NOT LIKE');
    ...
    +    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value), 'LIKE');
    ...
    +    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value), 'NOT LIKE');
    ...
    +    $this->query->addWhere($this->options['group'], $field, '%' . $this->connection->escapeLike($this->value) . '%', 'NOT LIKE');
    

    Shouldn't all the LIKE/NOT LIKE in StringFilter not also use getConditionOperator?

And this will need a change record for the update to the constructor and the addition of the getConditionOperator method I think.

slasher13’s picture

Status: Needs work » Needs review
StatusFileSize
new10.71 KB
new673 bytes

#21.1 done
#21.2 addWhere uses Connection::mapConditionOperator during \Drupal\Core\Database\Query\Condition->compile() and addWhereExpression doesn't.

Perhaps pointing out to use addWhereExpression with Connection::mapConditionOperator would be helpful for contrib.

lendude’s picture

+++ b/core/modules/views/src/Plugin/views/filter/Combine.php
@@ -162,45 +162,50 @@ protected function opContainsWord($expression) {
   protected function opStartsWith($expression) {
...
   protected function opNotStartsWith($expression) {
...
   protected function opEndsWith($expression) {
...
   protected function opNotEndsWith($expression) {
...
   protected function opNotLike($expression) {
...
   protected function opRegex($expression) {

Opened #2818017: A number of Views combined fields filter operators are currently pointless to an end user to clean up this mess of pointless operators in the combined field filter.

Most of these operator methods don't have any test coverage (and in the current format they just don't make any sense). So I think we either need to postpone this on #2818017: A number of Views combined fields filter operators are currently pointless to an end user and see what happens there or just add some minimal test coverage for all these operators to \Drupal\Tests\views\Kernel\Handler\FilterCombineTest.

Any other thoughts on this?

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Juterpillar’s picture

StatusFileSize
new10.71 KB

Thanks slasher13 and chanderbhushan. I've re-rolled patch 22 for 8.3.x.

Status: Needs review » Needs work

The last submitted patch, 26: 2784739-replace-db-like-26.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

meenakshig’s picture

StatusFileSize
new5.06 KB

As patch was not applying so i rerolled it for 8.4.x.

meenakshig’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 28: replace-db-like_2784739_28.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mradcliffe’s picture

Thank you for attempting a re-roll, @Meenakshi Gupta. The patch in #28 seems to not have all the changes in #26. Did you run into conflicts applying all of the changes in #26? A helpful way to determine what changes occurred between patches is to create an "interdiff" between 2 patches. You can learn more about how to create an interdiff at https://www.drupal.org/documentation/git/interdiff.

For a re-roll, an interdiff probably won't show any changes, but if you do see changes, then it's possible your new patch is missing changes from the old patch. It is not necessary to upload the interdiff file. However if we need to add/remove or make other changes in our new patch, then an interdiff should be posted in order to help patch reviewers.

sutharsan’s picture

Issue tags: +Vienna2017
sutharsan’s picture

Issue tags: +Novice
miiimooo’s picture

I'm at DC Vienna and having a look at this.

miiimooo’s picture

Version: 8.4.x-dev » 8.5.x-dev
StatusFileSize
new5.84 KB
new5.84 KB

Patch re-rolled for 8.5-x

miiimooo’s picture

Status: Needs work » Needs review
mradcliffe’s picture

Status: Needs review » Needs work

Thank you for the patch, @miiimooo.

I found a couple of minor code standard issues with the patch.

Also, it seems like code in patch from #26 and #28 is not in the patch in #35, and that code still applies. You should try to apply the changes from #28 as well.

@@ -23,6 +24,43 @@ class StringFilter extends FilterPluginBase {
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+      $container->get('database')
+      );

The ending parentheses should be indented at 4 spaces instead of 6 spaces.

@@ -236,8 +274,27 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
     }
   }
 
+  /**
+   * Overwrite equal operator for complex expressions.
+   *
+   * @return string
+   *   Overwritten, database driver specific operator.
+   */

I think the convention here is to use {@inheritdoc} for methods that are extended.

miiimooo’s picture

Status: Needs work » Needs review
StatusFileSize
new10.77 KB

Thanks for the review @mradcliffe

I had more time now and managed to incorporate all the above patches.

Status: Needs review » Needs work

The last submitted patch, 38: 2784739-38--replace_db_like.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

miiimooo’s picture

Status: Needs work » Needs review
StatusFileSize
new10.99 KB

Fix tests

Status: Needs review » Needs work

The last submitted patch, 40: 2784739-40--replace_db_like.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ivan berezhnov’s picture

Issue tags: +CSKyiv18

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mohit1604’s picture

Assigned: Unassigned » mohit1604
mohit1604’s picture

Status: Needs work » Needs review
StatusFileSize
new10.69 KB

Patch for version 8.6.x,8.5.x and 8.4.x, hope it shows green :)

mohit1604’s picture

Assigned: mohit1604 » Unassigned
mohit1604’s picture

mohit1604’s picture

What is Vienna2017 and CSKyiv18 to which this issue is tagged in ?

rosk0’s picture

Issue tags: -Vienna2017, -CSKyiv18

I think we can remove those tags as corresponding events are already past(obvious for DrupalCon, proof for CSKiyv18 https://groups.drupal.org/node/517964).

mradcliffe’s picture

Issue tags: +CSKyiv18, +Vienna2017

We should keep issue tags that are related to sprints because it is useful for sprint organizers to see a list of issues that were worked on during a sprint.

voleger’s picture

MerryHamster’s picture

zymbian’s picture

Status: Needs review » Reviewed & tested by the community

Patch #46 looks good, thanks for the patch. Marking RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

There should be a failing test at least on Postgres as this change claims to be a bugfix for something in Postgres. Also the issue summary should be updated to reflect what is being fixed.

What's also odd is that we're mixing a task - replacing db_like() with a bug fix. I think this issue should only do the necessary to "Fix PostgreSQL operator"... the "and replace db_like wherever possible in views" should be done by #2850037: Replace all calls to db_like(), which is deprecated

gawaksh’s picture

Assigned: Unassigned » gawaksh
Status: Needs work » Needs review
StatusFileSize
new8.58 KB

This should solve the issue.

Status: Needs review » Needs work

The last submitted patch, 56: FixOperator-2784739-56.patch, failed testing. View results

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

MerryHamster’s picture

StatusFileSize
new8.55 KB
new4.09 KB

Reroll #56 patch for 8.7.x

MerryHamster’s picture

Status: Needs work » Needs review
andypost’s picture

+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -2,8 +2,10 @@
+use Drupal\Core\Database\Connection;
...
+use Symfony\Component\DependencyInjection\ContainerInterface;

unused use - just remove it

MerryHamster’s picture

Assigned: gawaksh » Unassigned

Status: Needs review » Needs work

The last submitted patch, 59: 2784739-59.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

MerryHamster’s picture

StatusFileSize
new10.54 KB
new2.14 KB

Reroll #56 patch for 8.7.x and added changes with Dependency Injection from #46 patch.

MerryHamster’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 64: 2784739-64.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mradcliffe’s picture

I'm adding the Needs tests tag based on @alexpott in comment #55. I think that we should add a kernel test to assert the failure.

The issue title and summary mentions replacing db_like() and like @alexpott mentioned this should not be done in this issue. I added the Needs issue summary update tag because we should clarify the proposed resolution and remaining tasks. Not everyone is knowledgeable about PostgreSQL so it would be great to add an explanation of the bug. This would probably require some digging and background research.

voleger’s picture

Issue summary: View changes
StatusFileSize
new7.29 KB
new3.21 KB

Updated IS. Reverted changes that are out of scope.
Still requires IS update to clarify the proposed resolution and remaining tasks.

voleger’s picture

Title: Fix PostgreSQL operator and replace db_like wherever possible in views » Fix PostgreSQL operator in views

Forgot about the title update.

slasher13’s picture

https://www.drupal.org/pift-ci-job/1066793
11 coding standards messages

I can't open it, but use of short array syntax might be one of them.

voleger’s picture

StatusFileSize
new7.33 KB
new4.37 KB

addressed #70

andypost’s picture

Last patch was commited as part of db_like() conversion so only extra test coverage here makes sense

See https://cgit.drupalcode.org/drupal/commit/?id=a0608f0

andypost’s picture

Issue tags: +Needs reroll
kostyashupenko’s picture

Issue tags: -Needs reroll
StatusFileSize
new5.7 KB

In this patch mostly changed constructions like

db_like($this->value)
on:
$this->connection->escapeLike($this->value)

kostyashupenko’s picture

Status: Needs work » Needs review

The last submitted patch, 71: interdiff-2784739-68-71.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

sylvain lavielle’s picture

StatusFileSize
new5.4 KB

Looks like the #74 patch can no longer be applied.
There's a new one.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

daffie’s picture

Status: Needs review » Needs work

The patch looks good. Just a couple of minor points:

  1. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -300,8 +300,24 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
    +  /**
    +   * {@inheritdoc}
    +   */
       public function operator() {
    

    Where does the inherit comes from? I cannot find it.

  2. In the method Combine::opContainsWord() is the method mapConditionOperator() called. Can we there use the new method getConditionOperator().
  3. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -300,8 +300,24 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
    +  public function getConditionOperator($operator) {
    

    Does this "helper" method need to be public. Can we change it to a protected method?

  4. +++ b/core/modules/views/src/Plugin/views/filter/Combine.php
    @@ -133,13 +133,14 @@ public function validate() {
    -    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => $this->value]);
    ...
    +    $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => '%' . $this->connection->escapeLike($this->value) . '%']);
    

    Adding the $this->connection->escapeLike() should not be part of this patch. It is out of scope for this issue.

anmolgoyal74’s picture

Status: Needs work » Needs review
StatusFileSize
new5.27 KB
new1.59 KB

Addressed #82.1,#82.3,#82.4
For #82.2, In #80, It is already using the new method getConditionOperator.

lendude’s picture

Status: Needs review » Needs work

Still needs test coverage

daffie’s picture

Assigned: Unassigned » daffie
Issue tags: -Novice

Working on the tests.

daffie’s picture

Assigned: daffie » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new13.58 KB
new18.21 KB

Added tests and also fixed a number of "LIKE"'s in StringFilter.php

lendude’s picture

Status: Needs review » Needs work

@daffie very nice! Can we get a test-only patch too? Just some nitpicks that I see:

  1. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -299,8 +299,27 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
    +   * Get query's operator.
    

    This needs to be a better sentence 'Get the query operator.' would probably do?

  2. +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
    @@ -299,8 +299,27 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
    +   *   Returns LIKE or NOT LIKE based on the query's operator.
    

    This isn't correct anymore, it can return more then that

  3. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter equal.
    

    "Tests the Combine field filter using the 'equal' operator."

  4. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +        'fields' => [
    +          'job',
    +        ],
    

    Using the combined field filter with one field is a bit weird, but I totally agree it is the only logical use when using these operators ¯\_(ツ)_/¯

  5. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter starts.
    

    "Tests the Combine field filter using the 'start' operator."

  6. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter not_starts.
    

    "Tests the Combine field filter using the 'not_starts' operator."

  7. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter ends.
    

    "Tests the Combine field filter using the 'ends' operator."

  8. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter not_ends.
    

    "Tests the Combine field filter using the 'not_ends' operator."

  9. +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
    @@ -281,6 +281,294 @@ public function testNonFieldsRow() {
    +   * Tests the Combine field filter not.
    

    "Tests the Combine field filter using the 'not' operator."

daffie’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Updated the IS.

daffie’s picture

Status: Needs work » Needs review
StatusFileSize
new2.76 KB
new9.92 KB
new18.37 KB

Updated the patch for the comment #87 from @lendude.
Also added a tests only patch.

mradcliffe’s picture

Status: Needs review » Needs work
Issue tags: +Europe2020

I reviewed the latest patch. The usage of the getConditionOperator() method is clean and shouldn't pose any risk.

I found one nitpick code standard issue in that patch.

+++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php
@@ -299,8 +299,28 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
+   *   Condition operator.
+   * @return string

Nit: There should be a separate line between @param and @return annotations

[x] Separate the @param and @return sections by a blank line

daffie’s picture

Status: Needs work » Needs review
StatusFileSize
new502 bytes
new18.38 KB

Fixed the coding standard violation.

lendude’s picture

Status: Needs review » Reviewed & tested by the community

Nothing further to add, looks good to me.

  • catch committed e4e0d0b on 9.2.x
    Issue #2784739 by slasher13, daffie, miiimooo, voleger, MerryHamster,...

  • catch committed c81480e on 9.1.x
    Issue #2784739 by slasher13, daffie, miiimooo, voleger, MerryHamster,...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.