-
Notifications
You must be signed in to change notification settings - Fork 44
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
Accessing entity storage in service constructors causes a container error. #140
Labels
Comments
A quick fix patch without tests. |
Adds a demonstration test. |
mxr576
added a commit
to mxr576/apigee-edge-drupal
that referenced
this issue
Feb 28, 2019
@Jaesin Thanks for the detailed description and especially for the tests files, please test my fix from the #141. $ ./test.sh web/modules/contrib/apigee_edge/modules/apigee_edge_teams/tests/src/Kernel/DependencyInjectionTest.php
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.17 with Xdebug 2.6.0
Configuration: /var/www/html/web/core/phpunit.xml.dist
Testing Drupal\Tests\apigee_edge_teams\Kernel\DependencyInjectionTest
Test 'Drupal\Tests\apigee_edge_teams\Kernel\DependencyInjectionTest::testDependencyInjection' started
Test 'Drupal\Tests\apigee_edge_teams\Kernel\DependencyInjectionTest::testDependencyInjection' ended
Time: 1.54 seconds, Memory: 6.00MB
OK (1 test, 1 assertion) |
140-2-better-test-only.diff.txt POC for #141 |
Was been fixed by #144 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual Behavior
Rebuilding the container cache will fail if a service used in an entity hook accesses a the entity storage.
Expected Behavior
All services should be Inject-able.
Steps to Reproduce the behavior
Call a service during an entity hook that injects the
apigee_edge_teams.team_permissions
service.Proposed Solution
Only the entity type manager in services and don't use then in the constructor.
The text was updated successfully, but these errors were encountered: