Since #1995048: EntityListController::getOperations() should respect access checks went in, all entity types with list controllers need an access controller.
FilterFormat doesn't have one.

More importantly, no tests failed.

To reproduce, go to admin/config/content/formats and notice you have no links to edit the formats.

Uploading a patch from that issue, but it needs tests first anyway.

Comments

alexpott’s picture

We need to add a test using clickLink() so that we actually test the page

a_c_m’s picture

Ok, been digging about.

I see the error. But don't understand why its not failing as is ?

I've viewed source on admin/config/content/formats and i can't find the link the test asserts should be there ()... so i'm confused as to how the $this->assertLinkByHref isn't failing...

Also clickLink (https://api.drupal.org/api/drupal/modules!simpletest!drupal_web_test_cas...) doesn't appear to have a way to select which version of the link you want, as there may be more than one "Configure" link on the page, i wanted to be sure we were clicking the right one.

As i'm new to all this i expect i'm missing the point somewhere.

a_c_m’s picture

So yeah, turns out its sort of an issue with assertLinkByHref which checks for contains, instead of an exact match.

ContactSiteWideTest.php has a fix, which i will copy. But, it looks like that code had its own issue ;) So will fix that as well in another issue (#2031211: Check for URL's absence will always pass due to wrong var name)

a_c_m’s picture

a_c_m’s picture

Status: Active » Needs review
StatusFileSize
new2.61 KB

Putting both patches together.

The last submitted patch, filter-access-controller-2030129-5.patch, failed testing.

a_c_m’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
a_c_m’s picture

StatusFileSize
new3.92 KB

adding missing file.

Status: Needs review » Needs work

The last submitted patch, filter-access-controller-2030129-8.patch, failed testing.

berdir’s picture

Looks like a random fail: Last checked is updated Other LocaleUpdateCronTest.php 120 Drupal\locale\Tests\LocaleUpdateCronTest->testUpdateCron().

berdir’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

This looks good, thank you.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Noticed a comment error... did the following change on change (thanks @berdir)

-    // Cannot use ::assertNoLinkByHref as it does partial url matching and with
-    // field_ui enabled 'admin/config/content/formats/manage/' . $format_id . '/disable' may exist.
+    // Cannot use the assertNoLinkByHref method as it does partial url matching
+    // and 'admin/config/content/formats/manage/' . $format_id . '/disable'
+    // exists.

Committed 165ec2c and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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