Quantity Rule is having wrong operator in its rule
'operator' => '<', which should be 'operator' => '>',

Last Order rule uses wrong order status selection

Condition to check if order is created less than 5 minutes uses wrong value,
I.e it uses minutes function gives the value in minutes not in timestamp,
It should use already provided function in the module commerce_fraud_timestamp_from_minutes

Comments

Vishalghyv created an issue. See original summary.

vishalghyv’s picture

Firing rules after the event of saving order doesn't seem to be right for now.
Please excuse if anything is wrong.

vishalghyv’s picture

And there is a change required in line 38 of the file commerce_fraud.rules_default.inc
For the rule Increase fraud score if order has x amount of products.

'operator' => '<', Should be changed to

'operator' => '>',

It worked in my system

vishalghyv’s picture

po box rule is not firing even when the condition is negated, which doesn't make sense as if its not false should become true,
Maybe I am missing something

vishalghyv’s picture

https://www.drupal.org/project/commerce/issues/1976480
Could be a issue to help resolve po box problem (Also a self reminder)

vishalghyv’s picture

Have added the patch for po box in issue https://www.drupal.org/project/commerce_fraud/issues/2977626

vishalghyv’s picture

StatusFileSize
new112.81 KB

Wrong Data Selector for commerce_fraud_last_order rule, Although using direct input option in rules does fix it

vishalghyv’s picture

Also the condition to select completed orders should check for commerce_fraud_timestamp_from_minutes in the above rule

vishalghyv’s picture

Status: Active » Needs review
StatusFileSize
new12.19 KB
tr’s picture

I triggered a test of your patch.

Note that if you want to reference other issues like https://www.drupal.org/project/commerce/issues/1976480 you can use this syntax: [ #1976480] (I had to add a space before the # so this would display properly, but you should remove that)

vishalghyv’s picture

StatusFileSize
new2.52 KB
vishalghyv’s picture

In this patch problems mentioned in #3 , #7 and #8 are fixed. Is there need to create different patches for them?
Or any changes....
#3 problems is fixed
#7 I have removed the array to select the order statuses if it is required then will find a way to bring it back
#8 Is working in my system but if any other thing is required I will fix it.

vishalghyv’s picture

Status: Needs review » Needs work
  • Last minute order rule have to be improved
vishalghyv’s picture

Status: Needs work » Needs review
StatusFileSize
new2.72 KB
  • Corrected Quantity rule
  • Correct query in Last minute order rule
  • Correct Last minute order selection parameters
derekcresswell’s picture

Status: Needs review » Reviewed & tested by the community

The changes here look ok to me. Though I must ask, is this achieving everything set out in the issue summary or do we need to create different issues.

In the summary :

Firstly, the rules are by default not enabled even when the module is installed, Since the rules are very strong so maybe it should be mentioned in the docs to go in workflow rules and enable them

This has not been done in the current patch. Is this going to be put in here or do we need to create a seperate patch / issue for this.

Marking as RTBC because it seems good in it's current state.

vishalghyv’s picture

Thanks for the review,
About the documentation maybe after few things are committed probably be better,
But If it is required then I don't have any problem will add the patch.
And regarding PO box it is in #2781513: PO Box Regex

derekcresswell’s picture

Related issues should be marked under the "Issue summary & relationships" section.

I think that something like that could warrant a separate issue. We just don't want one issue to deal with multiple problems at once (usually).

vishalghyv’s picture

Issue summary: View changes
Related issues: +#2781513: PO Box Regex

Surely will add it in different issue.
Added relating issue

joshmiller’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests, +Needs issue summary update

Needs tests and an issue summary rewrite. Please rewrite the summary and title of this issue to address the issues your patch is fixing. Also, please write tests that show these things are broken and need fixing.

vishalghyv’s picture

Title: Some likely problem in Rules » Fixes required in Quantity and Last Order Rule
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new4.65 KB
new2.51 KB
  • Added the tests for both rule
  • Changed Issue title and status

  • joshmiller committed f0398f5 on 7.x-1.x authored by Vishalghyv
    Issue #3135019 by Vishalghyv, DerekCresswell, TR, joshmiller: Fixes...
joshmiller’s picture

Status: Needs review » Fixed

Thanks @Vishalghyv :)

Status: Fixed » Closed (fixed)

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