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

UFMatch - E_NOTICE when nonexistent uf_id #21576

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

demeritcowboy
Copy link
Contributor

Overview

Calling CRM_Core_BAO_UFMatch::getUFValues with a nonexistent uf_id gives an E_NOTICE.

Before

E_NOTICE

After

No notice.
Also use civi::statics.

Technical Details

The main thing is it calls return $ufValues[$ufID]; without checking if it actually did set it.

Comments

@civibot
Copy link

civibot bot commented Sep 22, 2021

(Standard links)

@@ -624,21 +624,20 @@ public static function getUFValues($ufID = NULL) {
return [];
}

static $ufValues;
if ($ufID && !isset($ufValues[$ufID])) {
if ($ufID && !isset(Civi::$statics[__CLASS__][__FUNCTION__][$ufID])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but FYI the if ($ufID part is redundant with the if (!$ufID) above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'll update.

@eileenmcnaughton
Copy link
Contributor

another one bites the dust

@eileenmcnaughton eileenmcnaughton merged commit a6d36b5 into civicrm:master Sep 22, 2021
@demeritcowboy demeritcowboy deleted the ufval branch September 22, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants