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.
1 Answer
This looks like a typo in the code. I've moved this to an issue and linked a PR:
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)) {
-
Thanks, and yes that fixes the problem. I added comment to the issue Commented Aug 11 at 15:28
-