Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As per #1952394-120: Add configuration translation user interface module in core point 21, we should use similar code to https://api.drupal.org/api/drupal/core%21modules%21system%21lib%21Drupal....
Comment | File | Size | Author |
---|---|---|---|
#14 | not-empty-route.patch | 1.52 KB | Gábor Hojtsy |
#11 | interdiff.txt | 2.35 KB | Gábor Hojtsy |
#11 | edit-check-access-11.patch | 12.93 KB | Gábor Hojtsy |
#9 | edit-check-access-9.patch | 13.08 KB | Gábor Hojtsy |
#9 | interdiff.txt | 7.13 KB | Gábor Hojtsy |
Comments
Comment #1
Gábor HojtsyUntested patch.
Comment #2
Gábor HojtsyComment #4
Gábor HojtsyWups, forgot to update static create.
Comment #6
Gábor HojtsyInject router, pass on route to be able to find the route for the path.
Comment #8
Gábor HojtsyIt helps if I inject all the needed services. Also pretty ridiculous that I need to inject so much to check access to paths :/
Comment #9
Gábor HojtsyWith specific tests for edit access checking. On site information page and contact category translation page, so both regular config and config entities are covered. The later also has dynamic parts on the URI, so tests that this works with params.
Comment #11
Gábor HojtsyIt was failing not because the edit link was showing up but because the edit link is a prefix to the fuller translation links to the xpath matched given its use of contains(@href...). I was thinking about checking more specific links, but then it may match the breadcrumb still :D So with more concrete checking on the Edit link done in situations when there are no translations to edit (only to add), we can more precisely target this situation and properly ensure this link will not be there. Works for me :)
Comment #12
Gábor HojtsyCommitted this one :)
Comment #13
tstoecklerI think we either need to bubble up the exception (i.e. not catch it) or do a if (!empty($route_request)) above.
Comment #14
Gábor HojtsyYeah. The method was directly taken from the breadcrumb code, so I'd keep it as close to that as makes sense. Modifying the caller then. (Also theoretically the base route will always be there, since we base the translation tab on the edit path, but you never know :)
Comment #15
Gábor HojtsyCommitted that, thanks for the review :)
Comment #16
tstoecklerThanks!