$this->messenger->addWarning($this->t('Fields that apply to all languages are hidden to avoid conflicting changes. <a href=":url">Edit them on the original language form</a>.',[':url'=>$url]));
$message['warning'][]=$this->t('Fields that apply to all languages are hidden to avoid conflicting changes. <a href=":url">Edit them on the original language form</a>.',[':url'=>$url]);
// Explicitly renders this warning message. This prevents repetition on
// AJAX operations or form submission. Other messages will be rendered in
$expected_message=sprintf('Fields that apply to all languages are hidden to avoid conflicting changes. <a href="%s">Edit them on the original language form</a>.',$entity->toUrl('edit-form')->toString());
@@ -159,10 +143,7 @@ public function providerTestEntityFormSharedElements() {
'default_translation_affected'=>TRUE,
'default_translation'=>TRUE,
'translation_form'=>FALSE,
'is_submitted'=>TRUE,
'is_rebuilding'=>TRUE,
'expected'=>$element,
'display_warning'=>FALSE,
];
$element=[
@@ -226,6 +207,16 @@ public function providerTestEntityFormSharedElements() {
'name'=>[
'#type'=>'textfield',
],
'hidden_fields_warning_message'=>[
'#theme'=>'status_messages',
'#message_list'=>[
'warning'=>[t('Fields that apply to all languages are hidden to avoid conflicting changes. <a href=":url">Edit them on the original language form</a>.')],
],
'#weight'=>-100,
'#status_headings'=>[
'warning'=>t('Warning message'),
],
],
];
$expected=$element;
$expected['name']['#access']=FALSE;
@@ -233,13 +224,6 @@ public function providerTestEntityFormSharedElements() {