Page MenuHomePhabricator

Add param id check for customField getFieldOptions
Closed, ResolvedPublic

Description

Caused by some civi report:
can see the log from frlog1002:/var/log/remote by grep getFieldOptions *

TypeError: Argument 1 passed to CRM_Core_BAO_CustomField::getFieldOptions() must be of the type int, null given, called in /srv/org.wikimedia.civicrm/drupal/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php on line 808 in CRM_Core_BAO_CustomField::getFieldOptions() (line 2978 of /srv/org.wikimedia.civicrm/drupal/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).

need civi upstream update

Event Timeline

Change 985071 had a related patch set uploaded (by Wfan; author: Wfan):

[wikimedia/fundraising/crm@master] Add param check before get options from cache

https://gerrit.wikimedia.org/r/985071

I took a quick peek at the code & it looks like id *shoud* be populated when it gets to that point which makes me wonder if the error is the symptom, not the cause - do we have any more info about how this error arises? I'm not sure if we should be quietly ignoring (per the patch) or possibly throwing an exception when that condition occurs

Change 987497 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Pull in latest extended reports

https://gerrit.wikimedia.org/r/987497

Change 987497 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Pull in latest extended reports

https://gerrit.wikimedia.org/r/987497

greg triaged this task as Medium priority.Jan 5 2024, 5:11 PM

Change 985071 abandoned by Wfan:

[wikimedia/fundraising/crm@master] Add param check before get options from cache

Reason:

fixed by update the report, no need to do additional check anymore

https://gerrit.wikimedia.org/r/985071