Support from Acquia helps fund testing for Drupal Acquia logo

Comments

broeker’s picture

Assigned: Unassigned » broeker

working on it

broeker’s picture

Status: Active » Needs review
FileSize
1.02 KB

Status: Needs review » Needs work

The last submitted patch, rename_op_longer-2003566-2.patch, failed testing.

zschmid’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.phpundefined
@@ -326,7 +326,7 @@ function op_shorter($field) {
+  function addLongerThan($field) {
     $placeholder = $this->placeholder();
     $this->query->add_where_expression($this->options['group'], "LENGTH($field) > $placeholder", array($placeholder => $this->value));

I believe the addLongerThan function should be public

broeker’s picture

Status: Needs work » Needs review
FileSize
1.02 KB

Added public to addLongerThan function

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

In #2003582: Rename Views method op_equal() to opEqual() it was decided to not rename a function from op_whatever to addWhatever. So to be consistent this patch should just change the name to opLongerThan - i'm okay with adding the Than here as this is what it does.

broeker’s picture

Status: Needs work » Needs review
FileSize
1.02 KB

Changed op_longer to opLongerThan per comment in #7 . . .

heddn’s picture

Title: Rename Views method op_longer() to addLongerThan() » Rename Views method op_longer() to opLongerThan()

Fixing title

dawehner’s picture

Status: Needs review » Needs work

Thanks for your work.
Method should be protected

broeker’s picture

Status: Needs work » Needs review
FileSize
1.03 KB

I was unclear whether this should be a public or protected function but per dawehner I've now changed it to a protected method:

-  function op_longer($field) {
+  protected function opLongerThan($field) {
     $placeholder = $this->placeholder();
     $this->query->add_where_expression($this->options['group'], "LENGTH($field) > $placeholder", array($placeholder => $this->value));
   }
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Perfect

webchick’s picture

Title: Rename Views method op_longer() to opLongerThan() » Change notice: Rename Views method op_longer() to opLongerThan()
Project: Drupal core » Views (for Drupal 7)
Version: 8.x-dev » 8.x-3.x-dev
Component: views.module » Code
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed and pushed to 8.x. Thanks!

Moving to Views for the change notice.

xjm’s picture

Title: Change notice: Rename Views method op_longer() to opLongerThan() » Rename Views method op_longer() to opLongerThan()
Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
Assigned: broeker » Unassigned
Status: Active » Fixed
Issue tags: -Needs change record

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