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 given
Proposed 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
Comments
Comment #2
nchiasson commentedGenerated a patch file for the proposed work.
Comment #4
paulocsThanks!
Comment #5
paulocs