Commit 792882dd authored by webchick's avatar webchick

Issue #2142553 by swentel, tim.plunkett, alweb, aspilicious: Field UI Local...

Issue #2142553 by swentel, tim.plunkett, alweb, aspilicious: Field UI Local tasks are incorrect on any entity.
parent ada9c9da
...@@ -46,7 +46,7 @@ public function appliesTo() { ...@@ -46,7 +46,7 @@ public function appliesTo() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function access(Route $route, Request $request, AccountInterface $account) { public function access(Route $route, Request $request, AccountInterface $account) {
if ($entity_type = $request->attributes->get('entity_type')) { if ($entity_type = $route->getDefault('entity_type')) {
$form_mode = $request->attributes->get('form_mode_name'); $form_mode = $request->attributes->get('form_mode_name');
if (!($bundle = $request->attributes->get('bundle'))) { if (!($bundle = $request->attributes->get('bundle'))) {
......
...@@ -46,7 +46,7 @@ public function appliesTo() { ...@@ -46,7 +46,7 @@ public function appliesTo() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function access(Route $route, Request $request, AccountInterface $account) { public function access(Route $route, Request $request, AccountInterface $account) {
if ($entity_type = $request->attributes->get('entity_type')) { if ($entity_type = $route->getDefault('entity_type')) {
$view_mode = $request->attributes->get('view_mode_name'); $view_mode = $request->attributes->get('view_mode_name');
if (!($bundle = $request->attributes->get('bundle'))) { if (!($bundle = $request->attributes->get('bundle'))) {
......
...@@ -52,6 +52,10 @@ public function testFieldUIRoutes() { ...@@ -52,6 +52,10 @@ public function testFieldUIRoutes() {
$this->drupalGet('admin/structure/types/manage/article/fields'); $this->drupalGet('admin/structure/types/manage/article/fields');
$this->assertTitle('Manage fields | Drupal'); $this->assertTitle('Manage fields | Drupal');
$this->drupalGet('admin/structure/types/manage/article');
$this->assertLink('Manage display');
$this->assertLink('Manage form display');
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment