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

Undefined array key "groupName" (Elections broken on CiviCRM >=5.47) #12

Closed
simonwiles opened this issue Sep 22, 2023 · 5 comments
Closed

Comments

@simonwiles
Copy link

simonwiles commented Sep 22, 2023

As of this morning my CiviCRM cron jobs are returning the following line:

[PHP Warning] Undefined array key "groupName" at /var/www/html/wp-content/uploads/civicrm/ext/au.com.agileware.elections-master/elections.php:513

Any ideas what might be going on here, and how I might debug it? Thanks!

PHP: 8.0.30
CiviCRM: 5.65.2
Elections: 1.2.3

@simonwiles
Copy link
Author

simonwiles commented Sep 23, 2023

The error is caused because the Elections extension is not compatible with the latest CiviCRM code.

https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMailParams/#details

$params array used to include valueName and groupName. These should not be referenced as they will stop working in future upgrades. The option groups they referred to are obsolete & will also be phased out. workflow should be checked instead.

It's not immediately obvious to me how the code should be updated, but this will have to be addressed somehow.

Edit: the parameter Elections is using was officially announced as removed in CiviCRM 5.43 (see here) after being marked as deprecated for over a year (I think the code was actually removed in 5.47). Here's where the code for the CDNTaxReceipts extension was updated to account for the new API. I'm not sure if this fix can be straightforwardly applied mutatis mutandis to Elections or not. Would be grateful for some input from @agileware-justin or someone else who has worked on this (CiviCRM newbie here, and it's been donkeys' years since I've done much php).

@simonwiles simonwiles changed the title Undefined array key "groupName" Undefined array key "groupName" (Elections broken on CiviCRM >=5.47) Sep 23, 2023
@agileware-justin
Copy link
Contributor

What version of PHP is the CLI using?

@simonwiles
Copy link
Author

simonwiles commented Nov 23, 2023

Hi! The CLI's using the same version of PHP as the site: 8.0.30 at time of filing this issue. I have a test environment running on top of the official WordPress docker container, which is currently built on top of php:8.0-fpm.

@nickperkins
Copy link
Contributor

@agileware-justin This is related to a change in the hook interface as @simonwiles mentions, not a php versioning issue. It looks like groupName should now be workflow but I'm not 100% sure.

@agileware-justin
Copy link
Contributor

Should be fixed in the 1.2.5 release. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants