Problem/Motivation
Once #2313309: Admin toolbar should always be rendered in the admin language (if set) lands, we would need to update the Drupal\login_destination\LoginDestinationToolbarLinkBuilder constructor. Let's stop extending the decorated class so we don't have to update constructors in the future.
Steps to reproduce
Visit any page showing the toolbar with a patch from #2313309: Admin toolbar should always be rendered in the admin language (if set) applied.
Proposed resolution
Stop extending the decorated class.
| Comment | File | Size | Author |
|---|
Issue fork login_destination-3261748
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 #3
dieterholvoet commentedI attached a patch of the current state of the MR for easy inclusion in projects.
Comment #4
dieterholvoet commentedComment #5
parisek@DieterHolvoet there is better way to fix this
login_destination implements a decorator pattern, but in the wrong way. It is completely up to contrib to make sure the implementations are correct.
Side information: decorators should not extend the class they're decorating. They should implement the correct interface, implement all methods and use $this->inner->method calls for each method they're not decorating. This mistake is made often though, but it shouldn't block improvements from going in core imo.
https://www.drupal.org/project/drupal/issues/2313309#comment-14188467
Comment #6
dieterholvoet commentedGood catch! I updated the PR, this doesn't need to be postponed anymore.
Comment #7
parisekWorks for me on several projects for months - RTBC
Thank you
Comment #10
rsvelko commentedupdated the merge request branch, then merged PR/MR.
Tada!