-
Notifications
You must be signed in to change notification settings - Fork 9.4k
PHP 8.5 deprecation warning: null locale used as array key in Magento\Framework\Locale\Currency #40814
Copy link
Copy link
Open
Labels
Area: FrameworkComponent: Framework/FileIssue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responsePriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReported on 2.4.9Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Metadata
Metadata
Assignees
Labels
Area: FrameworkComponent: Framework/FileIssue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responsePriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReported on 2.4.9Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Ready for Development
Preconditions and environment
📄 Description
Preconditions
Magento\Framework\Locale\Currency🧩 Problem
When executing Magento code that triggers currency resolution (e.g.
getCurrencySymbol()), PHP 8.5 emits a deprecation warning:The issue originates from
Magento\Framework\Locale\Currency::getCurrency().🔍 Affected Code
In
vendor/magento/framework/Locale/Currency.php:Steps to reproduce
🔁 Steps to Reproduce
📌 Impact
📎 Notes
Expected result
No PHP warnings should be triggered.
🛠 Suggested Fix
Normalize locale before array usage:
And reuse
$localeconsistently throughout the method.Locale value used as array key should always be safely normalized to a string.
Actual result
PHP emits warning:
Triggered during currency cache storage when locale is
nullor not normalized.Additional information
No response
Release note
No response
Triage and priority