Answers.Body: <p>It might well be, but this is not the way I would specify the rule. This condition was for something pretty different, I do not recollect what exactly.</p>
  
  <p>I would specify that the action is send email but the delay is xxxx number of days?</p>
  
  <p>Like so:</p>
  
  <p><a href="https://i.sstatic.net/Mn2lo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Mn2lo.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-27T12:15:46.097Z
Answers.Text: Delay is a useful tool, however not in my case. My goal is to ask for a repeated contribution n days after the last contribution was made. Using delay would result in asking for a repeated contribution even if the contribution was already repeated within n days.
Answers.UserDisplayName: Szelim Simándi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-27T14:09:57.643Z
Answers.Text: Sounds like you have to develop your own specific action then?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T11:15:14.317Z
Answers.LastActivityDate: 2020-02-26T11:15:14.317Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm trying to set up a rule in CiviRules that will <strong>send an e-mail n days after a contribution was made.</strong></p>
  
  <p>When I try to save the condition parameters I get an error message. </p>
  
  <p><strong>Can anyone confirm that this is a bug, or am I messing up something?</strong></p>
  
  <p>Error log: </p>
  
  <pre><code>2020/02/06 13:20:26 [error] 8317#8317: *280630 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to civicrm_api3() must be of the type string, null given, called in .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php on line 125 and defined in .../releases/20200204155448/web/app/plugins/civicrm/civicrm/api/api.php:84
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>#0 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php(125): civicrm_api3(NULL, 'getfields', Array)
  #1 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php(73): CRM_CivirulesConditions_Generic_ValueComparison-&gt;isDateField(NULL, NULL)
  #2 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Contribution/LastContribution.php(64): CRM_CivirulesConditions_Generic_ValueComparison-&gt;ge" while reading response header from upstream, client: [...], server: [...], request: "GET /wp/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fcivirule%2Fform%2Frule&amp;reset=1&amp;action=update&amp;id=2 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: [...], referrer: [...]/wp/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fcivirules%2Fform%2Frulesview&amp;reset=1"
  </code></pre>
  
  <p>I reproduced the bug on the demo site: </p>
  
  <p><a href="https://i.sstatic.net/03T8O.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/03T8O.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.sstatic.net/akzmk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/akzmk.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.sstatic.net/Q7Pno.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q7Pno.png" alt="enter image description here"></a></p>
  
Tags: <wordpress><contributions><civirules><condition>
Title: ValueComparison null error when adding 'Last contribution is more than n days ago or is n days ago' as condition
ThreadText: # ValueComparison null error when adding 'Last contribution is more than n days ago or is n days ago' as condition
  
  (Asked by: username_0 on 2020-02-06)
  
  I'm trying to set up a rule in CiviRules that will send an e-mail n days after a contribution was made.
  When I try to save the condition parameters I get an error message. 
  Can anyone confirm that this is a bug, or am I messing up something?
  Error log: 
  2020/02/06 13:20:26 [error] 8317#8317: *280630 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to civicrm_api3() must be of the type string, null given, called in .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php on line 125 and defined in .../releases/20200204155448/web/app/plugins/civicrm/civicrm/api/api.php:84
  
  Stack trace:
  #0 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php(125): civicrm_api3(NULL, 'getfields', Array)
  #1 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Generic/ValueComparison.php(73): CRM_CivirulesConditions_Generic_ValueComparison->isDateField(NULL, NULL)
  #2 .../shared/uploads/sites/5/civicrm/ext/org.civicoop.civirules/CRM/CivirulesConditions/Contribution/LastContribution.php(64): CRM_CivirulesConditions_Generic_ValueComparison->ge" while reading response header from upstream, client: [...], server: [...], request: "GET /wp/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcivirule%2Fform%2Frule&reset=1&action=update&id=2 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: [...], referrer: [...]/wp/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcivirules%2Fform%2Frulesview&reset=1"
  
  I reproduced the bug on the demo site:
  
  **Tags:** wordpress, contributions, civirules, condition
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-26. Score: 0
  
  It might well be, but this is not the way I would specify the rule. This condition was for something pretty different, I do not recollect what exactly.
  
  I would specify that the action is send email but the delay is xxxx number of days?
  
  Like so:
  
  [![enter image description here](https://i.sstatic.net/Mn2lo.png)](https://i.sstatic.net/Mn2lo.png)
  
  > **Comments:**
  > **username_0**: Delay is a useful tool, however not in my case. My goal is to ask for a repeated contribution n days after the last contribution was made. Using delay would result in asking for a repeated contribution even if the contribution was already repeated within n days.  
  > **username_1**: Sounds like you have to develop your own specific action then?  
  
  ---
  
  