Answers.Body: <p>This looks like a typo in the code. I've moved this to an issue and linked a PR:</p>
  <ul>
  <li><a href="https://lab.civicrm.org/dev/backdrop/-/issues/87" rel="nofollow noreferrer">https://lab.civicrm.org/dev/backdrop/-/issues/87</a></li>
  </ul>
  <p>If you want to test locally, just change this (line 589 on the file indicated in the error you posted):</p>
  <p><code>    if (!empty(rules)) {</code></p>
  <p>to this (adding the <code>$</code>):</p>
  <p><code>    if (!empty($rules)) {</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-11T15:28:30.883Z
Answers.Text: Thanks, and yes that fixes the problem.  I added  comment to the issue
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-12T01:37:24.257Z
Answers.Text: The fix is merged & will be in 5.78.0
Answers.UserDisplayName: eileen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-11T13:24:01.200Z
Answers.LastActivityDate: 2024-08-11T13:24:01.200Z
Answers.UserDisplayName: Laryn
Body: <p>When adding an 'Association Rule' in CiviGroup Roles sync I get the error 'Undefined constant &quot;rules&quot;'- this is with Backdrop 1.28.2, CiviCRM 5.75.2 and PHP 8.1.29.  The longer message is '<em>Undefined constant &quot;rules&quot; in civicrm_group_roles_add_rule_form_submit() (line 589 of /home/acivior2/public_html/modules/civicrm/backdrop/modules/civicrm_group_roles/civicrm_group_roles.module).</em>' This is 100% reproducible.  I can't test this on bmaster as it doesn't seem possible to access the Backdrop system settings &amp; therefore CiviGroup settings are not available to me.</p>
  
Tags: <backdrop><civigroup>
Title: CiviGroup module in BackDrop fails 'Undefined constant "rules"'
ThreadText: # CiviGroup module in BackDrop fails 'Undefined constant "rules"'
  
  (Asked by: username_0 on 2024-08-10)
  
  When adding an 'Association Rule' in CiviGroup Roles sync I get the error 'Undefined constant "rules"'- this is with Backdrop 1.28.2, CiviCRM 5.75.2 and PHP 8.1.29. The longer message is '*Undefined constant "rules" in civicrm\_group\_roles\_add\_rule\_form\_submit() (line 589 of /home/acivior2/public\_html/modules/civicrm/backdrop/modules/civicrm\_group\_roles/civicrm\_group\_roles.module).*' This is 100% reproducible. I can't test this on bmaster as it doesn't seem possible to access the Backdrop system settings & therefore CiviGroup settings are not available to me.
  
  **Tags:** backdrop, civigroup
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-08-11. Score: 2
  
  This looks like a typo in the code. I've moved this to an issue and linked a PR:
  
  * <https://lab.civicrm.org/dev/backdrop/-/issues/87>
  
  If you want to test locally, just change this (line 589 on the file indicated in the error you posted):
  
  `if (!empty(rules)) {`
  
  to this (adding the `$`):
  
  `if (!empty($rules)) {`
  
  > **Comments:**
  > **username_0**: Thanks, and yes that fixes the problem.  I added  comment to the issue  
  > **username_2**: The fix is merged & will be in 5.78.0  
  
  ---
  
  