Issue #2989657 by tetranz, Vidushi Mehta, longwave, Chris2, alexpott: Minor user interface text correction in BlockContentDeleteForm

8.7.x
Alex Pott 2018-09-14 15:12:52 +02:00
parent 8735b60b8c
commit c0ab589d67
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
1 changed files with 5 additions and 9 deletions

View File

@ -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();
}
}