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

D9 - Fix fatal error when relationship filter is added on contact field #835

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

jitendrapurohit
Copy link
Collaborator

Overview

Fix fatal error when relationship filter is added on contact field

Before

From https://www.drupal.org/project/webform_civicrm/issues/3336269

After updating the webform_civicrm module to 6.2.2 we began getting errors for forms with CiviCRM relationships. I am not sure whether this is unique to our installation or if it is a common issue. It did not exist with 6.2.1, and rolling back to 6.2.1 resolves our immediate problem.

The specific error we're seeing in the log is:

API_Exception: Unknown api parameter: setRelationship in Civi\Api4\Generic\AbstractAction->__call() (line 218 of /var/www/html/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php).

The form page is a wsod, but removing this line from the yaml '#default': relationship allows the page to load - not really sure why - but when submitting the form the same API_Exception occurs.

After

Fixed.

Technical Details

v4 does not accept irrelevant params and throws an error if passed in. Since wf_crm_contact_access() checks for the access to the contact, relationship param isn't required and can be ignored.

Comments

@KarinG

@pradpnayak
Copy link
Contributor

This patched worked for me

@jitendrapurohit
Copy link
Collaborator Author

Merging this based on above comment and reporter has confirmed the fix on the drupal issue - https://www.drupal.org/project/webform_civicrm/issues/3336269#comment-14898636

@jitendrapurohit jitendrapurohit merged commit 1bc1546 into colemanw:6.x Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants