Issue #2989657 by tetranz, Vidushi Mehta, longwave, Chris2, alexpott: Minor user interface text correction in BlockContentDeleteForm
parent
8735b60b8c
commit
c0ab589d67
|
@ -3,7 +3,6 @@
|
|||
namespace Drupal\block_content\Form;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityDeleteForm;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Provides a confirmation form for deleting a custom block entity.
|
||||
|
@ -15,15 +14,12 @@ class BlockContentDeleteForm extends ContentEntityDeleteForm {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(array $form, FormStateInterface $form_state) {
|
||||
public function getDescription() {
|
||||
$instances = $this->entity->getInstances();
|
||||
|
||||
$form['message'] = [
|
||||
'#markup' => $this->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'),
|
||||
'#access' => !empty($instances),
|
||||
];
|
||||
|
||||
return parent::buildForm($form, $form_state);
|
||||
if (!empty($instances)) {
|
||||
return $this->formatPlural(count($instances), 'This will also remove 1 placed block instance. This action cannot be undone.', 'This will also remove @count placed block instances. This action cannot be undone.');
|
||||
}
|
||||
return parent::getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue