-
-
Notifications
You must be signed in to change notification settings - Fork 813
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
fixes fatal error while loading smart group with deleted custom field #30699
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
@@ -562,6 +562,9 @@ public static function getKeyID($key, $all = FALSE) { | |||
* @throws CRM_Core_Exception | |||
*/ | |||
public static function getFieldObject($fieldID) { | |||
if (empty(self::getField($fieldID))) { | |||
return; | |||
} | |||
$field = new CRM_Core_BAO_CustomField(); | |||
$field->copyValues(self::getField($fieldID)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change this to a variable so the getField function doesn't have to be called twice.
@kurund this function is marked |
It is called by https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/BAO/Query.php#L4768 in my Civi instance (CiviCRM v5.71.2) Code is changed in master. There are still few instances of |
May be we can close this. |
this was fixed in #30104 |
No description provided.