Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add not exist greater than/ less then for segment filters #7126

Open
wants to merge 6 commits into
base: staging
from

Conversation

2 participants
@kuzmany
Copy link
Contributor

kuzmany commented Jan 11, 2019

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

Added segment filter not exist greater than/less then.
As follow up of this PR https://github.com/mautic/mautic/pull/7122/files

This allow use filters for example:

  • contacts with orders but not last_active from last month etc

Steps to test this PR:

  1. Load up this PR
  2. Create custom datetime
  3. If today is 14. 1. 2019 set this custom field to 10. 1. 2019
  4. Got to segments with operator not exists greater than 11 .1. 2019
    5: Wait
  5. Contact should be added to segment
  6. Change the filter to not exists greater than 9. 1. 2019
  7. Contact should be removed from segment
  8. Repeat same for not exist less than operator

@kuzmany kuzmany added this to the 2.15.1 milestone Jan 11, 2019

kuzmany added some commits Jan 11, 2019

@kuzmany kuzmany added Ready To Test and removed WIP labels Jan 14, 2019

@alanhartless alanhartless added this to Needs Testing in 2.15.1 Jan 14, 2019

kuzmany added some commits Jan 16, 2019

@alanhartless alanhartless added this to Changes Requested / Review in Mautic 2 via automation Jan 30, 2019

*
* @param $operatorOption
*/
public function modifyOperators($operatorOption)

This comment has been minimized.

@alanhartless

alanhartless Jan 30, 2019

Contributor

I'm not sure I'm a fan of this. I know we use inherited trait methods in other places in older code but it's not considered very "clean" by today's standards, especially with a pass by referenced array. I think the cleaner solution for this scenario is to pass an optional array into getFilterExpressionFunctions that gets merged into $operatorOption.

This comment has been minimized.

@alanhartless

alanhartless Jan 30, 2019

Contributor

Or consider refactoring away from this trait.

@alanhartless alanhartless moved this from Needs Testing to Discussion in 2.15.1 Jan 30, 2019

@alanhartless alanhartless removed this from Discussion in 2.15.1 Mar 11, 2019

@alanhartless alanhartless removed this from the 2.15.1 milestone Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.