Skip to content

[Issue] Replace 'static::' with 'self::' when accessing private const. #30781

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

Closed
2 of 4 tasks
m2-assistant bot opened this issue Nov 4, 2020 · 2 comments · Fixed by #30774
Closed
2 of 4 tasks

[Issue] Replace 'static::' with 'self::' when accessing private const. #30781

m2-assistant bot opened this issue Nov 4, 2020 · 2 comments · Fixed by #30774
Assignees
Labels
Component: Backend Component: Catalog Component: DownloadableImportExport 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: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Progress: PR in progress 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.

Comments

@m2-assistant
Copy link

m2-assistant bot commented Nov 4, 2020

This issue is automatically created based on existing pull request: #30774: Replace 'static::' with 'self::' when accessing private const.


Description

Magento 2.4 -develop

This PR prevents 'Undefined class constant' error if a plugin will be added for one of these classes. Example:

Related Pull Requests

#28797
#29925

Steps to reproduce:

Case 1

Create a plugin for : Magento\Backend\ViewModel\ChartDisabled class

Actual Result: ✖️ error occurs

Screenshot from 2020-11-05 13-20-42

Case 2

Create a plugin for : Magento\Catalog\Model\Config\LayerCategoryConfig class

Actual Result: ✖️ error occurs

Screenshot from 2020-11-05 14-43-46

Case 3

Create a plugin for : Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable class

Actual Result: ✖️ error occurs

2020-11-05_15-24

Expected Result: ✔️ No errors when plugins are called

Related Issues

  1. Do not recommend using static:: for private constants magento-coding-standard#197

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot added Component: Backend Component: Catalog Component: DownloadableImportExport Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Nov 4, 2020
@sidolov sidolov added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Nov 4, 2020
@engcom-Alfa engcom-Alfa added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 5, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Alfa
Thank you for verifying the issue. Based on the provided information internal tickets MC-38923 were created

Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@gabrieldagama
Copy link
Contributor

Hi @m2-assistant[bot]. Thank you for your report.
The issue has been fixed in #30774 by @vovayatsyuk in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Backend Component: Catalog Component: DownloadableImportExport 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: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Progress: PR in progress 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
Status: Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

5 participants