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

[REF][PHP8.2] Avoid dynamic properties in CRM_Case_Form_CaseView #25292

Merged
merged 1 commit into from
Jan 7, 2023

Conversation

braders
Copy link
Contributor

@braders braders commented Jan 7, 2023

Overview

Avoid dynamic properties in CRM_Case_Form_CaseView.

Before

Several properties set and retreived dynamically, which is deprecated in PHP 8.2. See https://lab.civicrm.org/dev/core/-/issues/3833 for context.

After

The properties are defined upfront, and are not dynamic.

I've also ensured _showRelatedCases is always a boolean (rather than simply a "truthy" value), which better reflects how it is used.

Also removes an unused $cId variable.

Technical Details

Most of these should probably be private, but given the number of dynamic properties across the codebase if we take that approach everywhere we're bound to break some extensions. For now I've marked the properties as internal to hopefully discourage usage by extensions, and the visibility can be revisited in future.

@civibot
Copy link

civibot bot commented Jan 7, 2023

(Standard links)

@civibot civibot bot added the master label Jan 7, 2023
@braders braders force-pushed the dynamic-properties-caseview branch from fc485e9 to 38d7803 Compare January 7, 2023 17:31
@demeritcowboy demeritcowboy merged commit eb29da0 into civicrm:master Jan 7, 2023
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