Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jun 2015 at 21:22 UTC
Updated:
21 Jul 2015 at 05:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
akalata commentedComment #2
akalata commentedComment #3
akalata commentedComment #4
akalata commentedComment #5
akalata commentedComment #6
les limLet's inject the
user.permissionsservice so we can use$this->permissionHandlerinstead.We already have $this->currentUser, so no need for \Drupal::currentUser() here. (That has nothing to do with your patch, but it's an easy thing to fix here.)
Also, since testbot didn't catch it, that means we probably need a test.
Comment #7
les limSure enough,
\Drupal\system\Tests\Form\ModulesListFormWebTestchecks for a configure link, but not a permissions link.Comment #8
cilefen commentedComment #9
cilefen commentedHere is a tests-only patch and a full patch.
Comment #11
les limFor the sake of completeness, we should also test that the "Help" link is shown. Some day we'll want to get rid of hook_help(), too.
Comment #12
cilefen commented#11 is out-of-scope. Add another issue for that.
Comment #13
cilefen commentedComment #14
cilefen commentedComment #15
les limAdded #2516690: Missing test for "Help" links per module on "Extend" admin page for testing the Help link.
Comment #16
cilefen commentedComment #17
les limThis is strange -- there's a previously existing system_test.permissions.yml file, but it's in the "src" directory. Does that even work? Git tells me it comes from #2464659: Routes that are varied by the 'user.permissions' cache context for anonymous users must also get the anonymous Role's cache tag.
Comment #18
cilefen commentedThat is strange. Permissions files don't go there.
Comment #19
cilefen commentedIt may be that *both* files are being read. Can you see if PageCacheTest fails without the other permisisons.yml file present? I think it will.
Comment #20
les limPageCacheTest passes even without any system_test.permissions.yml.
Technically, permissions.yml isn't required for testing; a permission check is just looking for a string, and that string is programmatically applied to the test user directly in the test method:
So I'd venture to say that the YAML file in "src" isn't doing anything at all.
Comment #21
cilefen commentedI don't want to just remove the file in this issue because #2464659: Routes that are varied by the 'user.permissions' cache context for anonymous users must also get the anonymous Role's cache tag intended it to be there, right or wrong. I think this calls for another novice issue and #9 is still open for review.
Comment #22
les lim#9 is well-formatted, narrowly scoped, and has verified tests. Looks good to me.
Comment #23
les limAdded novice task #2517114: Remove needless, wrongly-placed system_test.permissions.yml file, postponed on this issue.
Comment #24
webchickNice catch!
Committed and pushed to 8.0.x. Thanks! Go TC Drupal Go! :D
Comment #26
naveenvalechaThanks!
Added new line at the end of system_test.permissions.yml
Comment #27
cilefen commentedAnother follow-up issue: #2521758: Module anchors on Permissions pages do not get you where you would expect
Comment #28
naveenvalechachanging as per #26
Comment #29
cilefen commented@naveenvalecha It has already been committed. Open a follow-up issue to fix any missed problems.
Comment #30
cilefen commentedOh a committer knows about it. Ignore #29.
Comment #31
alexpott@naveenvalecha please open a follow-up issue - doing follow-ups on issue pollutes issue credit history.
Comment #32
alexpottAnd once the follow-up is created and linked can this issue by set to fixed.
Comment #33
naveenvalechaThanks! @alexpott! Fine to create the followup. Added followup https://www.drupal.org/node/2521774