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

Remove reference to undefined variable in CRM_Contact_Form_Inline_CommunicationPreferences #22840

Merged

Conversation

braders
Copy link
Contributor

@braders braders commented Feb 26, 2022

Overview

In #20214 a change was introduced which means the inline communication form references a missing variable. The biggest impact of that is that your PHP log is likely to end up with something like this:

PHP Notice:  Trying to get property '_action' of non-object in ..

The if statement could never be true, and setting a default on an edit form (as opposed to a create form) doesn't make much sense. Therefore I propose this block of code is removed.

Before

PHP notice.

After

No PHP notice.

@civibot civibot bot added the master label Feb 26, 2022
@civibot
Copy link

civibot bot commented Feb 26, 2022

(Standard links)

@demeritcowboy
Copy link
Contributor

This seems ok. Noting also that getContactDefaultLanguage never returns false so that inner if wouldn't quite work as intended if it even got there.

Separate: If on a new contact you clear the field intending to leave it blank, it seems to get filled in with a default anyway, but that happens before the patch too. I'm not really sure what blank would mean - any later code that sees blank would likely just use the site default.

@demeritcowboy demeritcowboy merged commit 134c71f into civicrm:master Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants