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

CommentFileSizeAuthor
#2 3301569-1.patch1.44 KBnchiasson

Issue fork context-3301569

Command icon 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

Alexander-Cairns created an issue. See original summary.

nchiasson’s picture

StatusFileSize
new1.44 KB

Generated a patch file for the proposed work.

  • quotics authored 9992ee1 on 8.x-4.x
    Issue #3301569 by Alexander-Cairns, quotics: UserProfilePage uses...
paulocs’s picture

Status: Active » Fixed

Thanks!

paulocs’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.