[Issue] Introduce separate BlockByIdentifier class to get Layout Block based on CMS Block Identifier #28309
Labels
Component: Cms
Fixed in 2.4.x
The issue has been fixed in 2.4-develop branch
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Priority: P3
May be fixed according to the position in the backlog.
Progress: done
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Severity: S3
Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
This issue is automatically created based on existing pull request: #28147: Introduce separate BlockByIdentifier class to get Layout Block based on CMS Block Identifier
Preconditions: (*)
The existing class is anti-pattern:
\Magento\Framework\Model\AbstractModel::load
to load Modelblock_id
is identifier, thegetIdentities
method returns same identity whatever the Scope is (return [\Magento\Cms\Model\Block::CACHE_TAG . '_' . $this->getBlockId()];
), which is painful when you use the sameidentifier
for multiple per-store CMS blocks.Why can't we fix the original Block? Some of developers might have used:
That is why we keep old Block backwards-compatible and introducing new one that can be used explicitly:
Related Pull Requests
Fixed Issues (if relevant)
Steps to reproduce (*)
Actual Result (*)
Expected Result (*)
Questions or comments
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: