Problem/Motivation
UserProfilePage uses Drupal\Core\Session\AccountProxy instead of Drupal\Core\Session\AccountProxyInterface and does not allow other implementers of the AccountProxyInterface to be used.
Steps to reproduce
Using the UserProfilePage plugin and a module that implements the AccountProxyInterface such as restrict_by_ip will cause a type error:
TypeError: Argument 6 passed to Drupal\context\Plugin\Condition\UserProfilePage::__construct() must be an instance of Drupal\Core\Session\AccountProxy, instance of
Drupal\restrict_by_ip\Session\AccountProxy givenProposed resolution
Use AccountProxyInterface instead of AccountProxy
Remaining tasks
User interface changes
None
API changes
Make the constructor of UserProfilePahge a AccountProxyInterface instead of an AccountProxy.
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3301569-1.patch | 1.44 KB | nchiasson |
Issue fork context-3301569
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nchiasson commentedGenerated a patch file for the proposed work.
Comment #4
paulocsThanks!
Comment #5
paulocs