Skip to content

Fix the issue #39944

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

Open
wants to merge 1 commit into
base: 2.4-develop
Choose a base branch
from

Conversation

iranimij
Copy link

This PR #37187 didn't fix the interceptor issue. Since the reflection class implements ScopeConfigInterface so I updated it to fix the condition.

Copy link

m2-assistant bot commented May 27, 2025

Hi @iranimij. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@ihor-sviziev
Copy link
Contributor

@iranimij, could you please provide more details? Which error are you getting? What are the steps to reproduce?

@iranimij
Copy link
Author

iranimij commented May 28, 2025

@ihor-sviziev The issue is exactly the same as the one we had here: #37187, but the solution did not fix the issue. I have a solution that fixes the issue. as far as I checked \Magento\TestFramework\App\Config\Interceptor does not implement InterceptorInterface but ScopeConfigInterface

@iranimij
Copy link
Author

@magento run all tests

@@ -127,7 +127,7 @@ public function reinitStores()
//In order to restore configFixture values
$testAppConfig = ObjectManager::getInstance()->get(Config::class);
$reflection = new \ReflectionClass($testAppConfig);
if ($reflection->implementsInterface(InterceptorInterface::class)) {
if ($reflection->implementsInterface(ScopeConfigInterface::class)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this check for ScopeConfigInterface OR InterceptorInterface? We need to make sure this works for the case, where there is a plugin defined, but also if there is no plugin.

@ihor-sviziev
Copy link
Contributor

@iranimij, I see it was tested in #37187 (comment), and looked as a working solution. Could you please clarify, if the steps are absolutely the same?

@iranimij
Copy link
Author

@ihor-sviziev I found out that it happens when the module : https://github.com/creatuity/magento2-interceptors is installed. When I disable this module, it does work properly. Can we apply my changes so that it can work with all modules? My solution seems a safer way.

@ihor-sviziev
Copy link
Contributor

@iranimij, then it looks like a bug in the https://github.com/creatuity/magento2-interceptors, because interceptors should implement the InterceptorInterface.
Unfortunately, I don't have the environment to check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants