Unverified Commit c0ab589d authored by alexpott's avatar alexpott
Browse files

Issue #2989657 by tetranz, Vidushi Mehta, longwave, Chris2, alexpott: Minor...

Issue #2989657 by tetranz, Vidushi Mehta, longwave, Chris2, alexpott: Minor user interface text correction in BlockContentDeleteForm
parent 8735b60b
......@@ -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();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment