Issue #2796045 by Lendude, abarrio, ranjith_kumar_k_u, megan_m, joachim,...
Issue #2796045 by Lendude, abarrio, ranjith_kumar_k_u, megan_m, joachim, alexpott, estoyausente, larowlan: Adding a field with relationship results in confusing error message when relationship is not present
(cherry picked from commit 5d4b11b2)
$errors[]=$this->t('The %handler_type %handler uses a relationship that has been removed.',['%handler_type'=>$handler_type_info['lstitle'],'%handler'=>$handler->adminLabel()]);
$errors[]=$this->t('The %relationship_name relationship used in %handler_type %handler is not present in the %display_name display.',[
@@ -362,8 +363,8 @@ public function testMissingRelationship() {
$errors=$view->validate();
// Check that the error messages are shown.
$this->assertCount(2,$errors['default'],'Error messages found for required relationship');
$this->assertEquals(t('The %handler_type %handler uses a relationship that has been removed.',['%handler_type'=>'field','%handler'=>'User: Last login']),$errors['default'][0]);
$this->assertEquals(t('The %handler_type %handler uses a relationship that has been removed.',['%handler_type'=>'field','%handler'=>'User: Created']),$errors['default'][1]);
$this->assertEquals(newFormattableMarkup('The %relationship_name relationship used in %handler_type %handler is not present in the %display_name display.',['%relationship_name'=>'uid','%handler_type'=>'field','%handler'=>'User: Last login','%display_name'=>'Default']),$errors['default'][0]);
$this->assertEquals(newFormattableMarkup('The %relationship_name relationship used in %handler_type %handler is not present in the %display_name display.',['%relationship_name'=>'uid','%handler_type'=>'field','%handler'=>'User: Created','%display_name'=>'Default']),$errors['default'][1]);