Revert "task: #3050199 Remove entity level constraint MenuSettingsConstraint that validates property only added in a form"
This reverts commit 214876bb.
$form_state->setErrorByName('menu][enabled',$this->t('You can only remove the menu link in the <em>published</em> version of this content.'));
}
// Handle all the other non-revisionable menu link changes in a pending
// revision.
elseif($defaults['entity_id']){
if($values['menu_name']!=$defaults['menu_name']){
$form_state->setErrorByName('menu][menu_parent',$this->t('You can only change the parent menu link for the <em>published</em> version of this content.'));
$form_state->setErrorByName('menu][menu_parent',$this->t('You can only change the parent menu link for the <em>published</em> version of this content.'));
}
elseif($values['weight']!=$defaults['weight']){
$form_state->setErrorByName('menu][weight',$this->t('You can only change the menu link weight for the <em>published</em> version of this content.'));
}
}
}
/**
* Form submission handler for menu item field on the node form.
@trigger_error('MenuSettingsConstraintValidator is 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',E_USER_DEPRECATED);