The route user/password may not be accessible under certain circumstances, but the link to it is still available in the user login block. Going to provide an MR later today to fix this.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | interdiff-3_5.txt | 567 bytes | gauravvvv |
| #5 | 3227816-5.patch | 1.16 KB | gauravvvv |
Issue fork drupal-3227816
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
jurgenhaasThinking about how to implement this, I came to the conclusion this belongs to core because that's the place where the link gets build and where we have to check access permission in the first place. It's not only the ldap module that may overwrite access to that route.
Comment #4
jurgenhaasComment #5
gauravvvv commentedRe-rolled patch #3, Fixed custom command failed. Attached interdiff for same.
Comment #6
jurgenhaas@Gauravmahlawat thanks for adding the comma, I forgot about that.
Q: would you mind editing the MR instead of switching to patch? I guess this would be easier in the long run, if this issue remains open and discusssed for a while.
Comment #7
el7cosmosPatches work for me.
I try to use
#accessin the render array to omit theifstatement, but somehowitem_liststill renders the<li>only with an empty child.Comment #8
joachim commentedRTBC based on @el7cosmos's review and a visual review from me.
Comment #9
alexpottRemoving the item from the render array can break contrib and custom code. Instead of the if set #access like so:
'#access' => $url->access(),And yes we probably should use #access for the create access link but that is a separate issue which could be opened.
Also bugs need a test so we don't break this in the future. Thinking about the test you're going to need to add a helper module that alters the route because atm the route definition is
So access is TRUE... so I'm interested in what
actually means. I.e. what are the certain circumstances.
Comment #10
jurgenhaas@alexpott yes, changing from an if statement to the #access control in the render array sounds great, but it causes the problem mentioned above in #7: the item-list template still outputs the li element in html and here is why:
The item for the password link still exists but its value is empty because of the #access set to FALSE. But that sounds like a different issue somewhere else.
One of the circumstances I came across is the use of the ldap module where you can configure exclusive mode, i.e. the user accounts are exclusively controlled by the ldap backend and hence it doesn't make sense to allow users to reset their password in Drupal.