MenuSettingsConstraint.php

Same filename and directory in other branches
  1. 11.x core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php
  2. 10 core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php
  3. 9 core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php
  4. 8.9.x core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php

Namespace

Drupal\menu_ui\Plugin\Validation\Constraint

File

core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php

View source
<?php

namespace Drupal\menu_ui\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Validation constraint for changing the menu settings in pending revisions.
 *
 * @deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Menu
 *   settings validation is now handled as a form validation callback in
 *   \Drupal\menu_ui\Hook\MenuUiHooks::formNodeFormValidate().
 *
 * @see https://www.drupal.org/node/3606616
 */
class MenuSettingsConstraint extends SymfonyConstraint {
  public function __construct(public $message = 'You can only change the menu settings for the <em>published</em> version of this content.', public $messageWeight = 'You can only change the menu link weight for the <em>published</em> version of this content.', public $messageParent = 'You can only change the parent menu link for the <em>published</em> version of this content.', public $messageRemove = 'You can only remove the menu link in the <em>published</em> version of this content.', ?array $groups = NULL, mixed $payload = NULL) {
    parent::__construct(groups: $groups, payload: $payload);
  }

}

Classes

Title Deprecated Summary
MenuSettingsConstraint

in drupal:11.5.0 and is removed from drupal:13.0.0. Menu settings validation is now handled as a form validation callback in \Drupal\menu_ui\Hook\MenuUiHooks::formNodeFormValidate().

Validation constraint for changing the menu settings in pending revisions.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.