Skip to content

More than core 80 blocks use _isScopePrivate in spite of being officially described as _not working properly_ #30506

Closed
@ericmorand

Description

@ericmorand

Preconditions (*)

Magento 2.3.5
Magento 2.4-develop

Steps to reproduce (*)

Search for the string $this->_isScopePrivate = true inside vendor/magento.

Expected result (*)

Since using the $_isScopePrivate property in blocks is obsolete and will not work properly, it should not be used by any block provided by Magento 2.

See: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/page-caching/private-content.html#config-cache-priv-how-block

Actual result (*)

More than 80 (eighty) blocks use that property, potentially leading to unexpected results, because Do not use the $_isScopePrivate property in your blocks. This property is obsolete and **will not work properly**.

Thoughts

Fixing this issue is nearly impossible for developers. It mean overriding every blocks that use that property. This needs to be fixed upstream. Or if the property works, the documentation needs to be updated.

As a matter of fact, it created some strange cache issues on blocks inheriting from \Magento\Checkout\Block\Onepage\Link where the block would first appear as expected then be replaced a few tenth of seconds later by a previsously cached version, probably grabbed from the local storage.

As long as this issue has not been fixed, we can't trust any of the 80+ concerned blocks: instanciation one of them or inheriting from one of them can lead to unexpected results.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Component: CodeIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPriority: P2A defect with this priority could have functionality issues which are not to expectations.Priority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.3.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions