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

Use null variables rather than isset in Core_Block #21957

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Use null variables rather than isset in Core_Block

Before

Variables may not be assigned - requiring checking with 'empty' or 'isset'

After

Variables always assigned - they might stay NULL or be overwritten later

Technical Details

This removes an isset from LangSwitch and some enotices that we see if escape on output is enabled.

'langSwitch' is normally always assigned by the smarty initialize but for some reason not via this path

Comments

This removes an isset from LangSwitch and some enotices that we see if escape on output is enabled.

'langSwitch' is normally always assigned by the smarty initialize but for some reason not via this path
@civibot
Copy link

civibot bot commented Nov 1, 2021

(Standard links)

@seamuslee001
Copy link
Contributor

Jenkins re test this please

public function ensureVariablesAreAssigned(array $variables): void {
foreach ($variables as $variable) {
if (!isset($this->get_template_vars()[$variable])) {
$this->assign($variable);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the actually value here that is getting assigned?

Copy link
Contributor

Choose a reason for hiding this comment

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

null is the default

@seamuslee001
Copy link
Contributor

This seems fine to me

@eileenmcnaughton eileenmcnaughton merged commit 39bc566 into civicrm:master Nov 4, 2021
@eileenmcnaughton eileenmcnaughton deleted the lang branch November 4, 2021 03:32
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