Commit d7d2dbc7 authored by Janis M's avatar Janis M Committed by Ines WALLON
Browse files

Issue #3201150 by bakop, niles38, liber_t, stefan.korn, joachim, attisan:...

Issue #3201150 by bakop, niles38, liber_t, stefan.korn, joachim, attisan: Undefined variable in ParagraphsUsageMenuLinks
parent 5a5c3ce5
Loading
Loading
Loading
Loading
+24 −19
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@
    "name": "drupal/paragraphs_usage",
    "type": "drupal-module",
    "description": "Check if an a paragraph is used in specific content types.",
  "keywords": ["Drupal"],
    "keywords": [
        "Drupal"
    ],
    "license": "GPL-2.0+",
    "homepage": "https://www.drupal.org/project/paragraphs_usage",
    "authors": [
@@ -18,5 +20,8 @@
    },
    "require": {
        "drupal/paragraphs": "^1.12"
    },
    "require-dev": {
        "drupal/admin_toolbar": "^3.1"
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class ParagraphsUsageMenuLinks extends DeriverBase implements ContainerDeriverIn
        ->loadMultiple();
      foreach ($paragraphs_type as $id) {
        $current_id = $id->id();
        $content_entity_bundle_root = "admin_toolbar_tools.extra_links:entity.paragraphs_type.edit_form.${$current_id}";
        $content_entity_bundle_root = "admin_toolbar_tools.extra_links:entity.paragraphs_type.edit_form.$current_id";

        $links[$current_id] = [
          'route_name' => 'entity.paragraphs_type.paragraphs_usage',
+42 −0
Original line number Diff line number Diff line
<?php

declare(strict_types = 1);

namespace Drupal\Tests\paragraphs_usage\Functional;

/**
 * Test menu link .
 *
 * @group paragraphs_usage
 */
class ParagraphsUsageAdminToolbarTest extends ParagraphsUsageTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = [
    'admin_toolbar_tools',
    'field_ui',
    'toolbar',
  ];

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->loginAsAdmin(['access administration pages', 'access toolbar']);
  }

  /**
   * Check if paragraph type as menulink.
   */
  public function testMenuLinkExist() {
    $this->addParagraphsType('test_paragraphs');
    $this->drupalGet('/admin/structure/paragraphs_type');
    $this->assertSession()->linkByHrefExists('/admin/structure/paragraphs_type/test_paragraphs/usage');
  }

}