drevops / behat-steps

🧪 A collection of Behat step definitions for Drupal
GNU General Public License v3.0
18 stars 13 forks source link

MenuTrait: Fix incorrectly throwing error on non-existing menu items. #253

Closed AlexSkrypnyk closed 2 months ago

AlexSkrypnyk commented 2 months ago
 public function menuLinksDelete(string $menu_name, TableNode $table): void {
    foreach ($table->getColumn(0) as $title) {
      try {
        $menu_link = $this->loadMenuLinkByTitle($title, $menu_name);
        if ($menu_link) {
          $menu_link->delete();
        }
      }
      catch (\Exception) {
        continue;
      }
    }
  }