diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index bffe7fc..7659ac0 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -353,7 +353,7 @@ function _filter_tips($format_id, $long = FALSE) { if ($filter->status) { $tip = $filter->tips($long); if (isset($tip)) { - $tips[$format->label()][$name] = array('tip' => $tip, 'id' => $name); + $tips[$format->getLabel()][$name] = array('tip' => $tip, 'id' => $name); } } } diff --git a/core/modules/filter/src/Controller/FilterController.php b/core/modules/filter/src/Controller/FilterController.php index fe4d94f..e06e7f8 100644 --- a/core/modules/filter/src/Controller/FilterController.php +++ b/core/modules/filter/src/Controller/FilterController.php @@ -47,7 +47,7 @@ function filterTips(FilterFormatInterface $filter_format = NULL) { * The label of the filter format. */ public function getLabel(FilterFormatInterface $filter_format) { - return $filter_format->label(); + return $filter_format->getLabel(); } } diff --git a/core/modules/filter/src/Element/TextFormat.php b/core/modules/filter/src/Element/TextFormat.php index 000984a..3b10adb 100644 --- a/core/modules/filter/src/Element/TextFormat.php +++ b/core/modules/filter/src/Element/TextFormat.php @@ -158,7 +158,7 @@ public static function processFormat(&$element, FormStateInterface $form_state, ); $options = array(); foreach ($formats as $format) { - $options[$format->id()] = $format->label(); + $options[$format->id()] = $format->getLabel(); $element['format']['guidelines'][$format->id()] = array( '#theme' => 'filter_guidelines', '#format' => $format, diff --git a/core/modules/filter/src/FilterFormatAddForm.php b/core/modules/filter/src/FilterFormatAddForm.php index 35c4ee2..ae7f98b 100644 --- a/core/modules/filter/src/FilterFormatAddForm.php +++ b/core/modules/filter/src/FilterFormatAddForm.php @@ -26,7 +26,7 @@ public function form(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); - drupal_set_message($this->t('Added text format %format.', array('%format' => $this->entity->label()))); + drupal_set_message($this->t('Added text format %format.', array('%format' => $this->entity->getLabel()))); return $this->entity; } diff --git a/core/modules/filter/src/FilterFormatEditForm.php b/core/modules/filter/src/FilterFormatEditForm.php index 3ce6905..befe30f 100644 --- a/core/modules/filter/src/FilterFormatEditForm.php +++ b/core/modules/filter/src/FilterFormatEditForm.php @@ -23,7 +23,7 @@ public function form(array $form, FormStateInterface $form_state) { throw new NotFoundHttpException(); } - $form['#title'] = $this->entity->label(); + $form['#title'] = $this->entity->getLabel(); $form = parent::form($form, $form_state); $form['roles']['#default_value'] = array_keys(filter_get_roles_by_format($this->entity)); return $form; @@ -34,7 +34,7 @@ public function form(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); - drupal_set_message($this->t('The text format %format has been updated.', array('%format' => $this->entity->label()))); + drupal_set_message($this->t('The text format %format has been updated.', array('%format' => $this->entity->getLabel()))); return $this->entity; } diff --git a/core/modules/filter/src/FilterFormatFormBase.php b/core/modules/filter/src/FilterFormatFormBase.php index b6abf1a..adc2cd6 100644 --- a/core/modules/filter/src/FilterFormatFormBase.php +++ b/core/modules/filter/src/FilterFormatFormBase.php @@ -58,7 +58,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['name'] = array( '#type' => 'textfield', '#title' => $this->t('Name'), - '#default_value' => $format->label(), + '#default_value' => $format->getLabel(), '#required' => TRUE, '#weight' => -30, ); diff --git a/core/modules/filter/src/FilterFormatListBuilder.php b/core/modules/filter/src/FilterFormatListBuilder.php index 0003cfa..6cdc0df 100644 --- a/core/modules/filter/src/FilterFormatListBuilder.php +++ b/core/modules/filter/src/FilterFormatListBuilder.php @@ -95,7 +95,7 @@ public function buildRow(EntityInterface $entity) { // Check whether this is the fallback text format. This format is available // to all roles and cannot be disabled via the admin interface. if ($entity->isFallbackFormat()) { - $row['label'] = String::placeholder($entity->label()); + $row['label'] = String::placeholder($entity->getLabel()); $fallback_choice = $this->configFactory->get('filter.settings')->get('always_show_fallback_choice'); if ($fallback_choice) { diff --git a/core/modules/filter/src/FilterPermissions.php b/core/modules/filter/src/FilterPermissions.php index 6e3fe7b..57e685f 100644 --- a/core/modules/filter/src/FilterPermissions.php +++ b/core/modules/filter/src/FilterPermissions.php @@ -59,7 +59,7 @@ public function permissions() { foreach ($formats as $format) { if ($permission = $format->getPermissionName()) { $permissions[$permission] = [ - 'title' => $this->t('Use the @label text format', ['@url' => $format->url(), '@label' => $format->label()]), + 'title' => $this->t('Use the @label text format', ['@url' => $format->url(), '@label' => $format->getLabel()]), 'description' => String::placeholder($this->t('Warning: This permission may have security implications depending on how the text format is configured.')), ]; } diff --git a/core/modules/filter/src/Form/FilterDisableForm.php b/core/modules/filter/src/Form/FilterDisableForm.php index 5795d8f..33ad51e 100644 --- a/core/modules/filter/src/Form/FilterDisableForm.php +++ b/core/modules/filter/src/Form/FilterDisableForm.php @@ -20,7 +20,7 @@ class FilterDisableForm extends EntityConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return $this->t('Are you sure you want to disable the text format %format?', array('%format' => $this->entity->label())); + return $this->t('Are you sure you want to disable the text format %format?', array('%format' => $this->entity->getLabel())); } /** @@ -49,7 +49,7 @@ public function getDescription() { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->disable()->save(); - drupal_set_message($this->t('Disabled text format %format.', array('%format' => $this->entity->label()))); + drupal_set_message($this->t('Disabled text format %format.', array('%format' => $this->entity->getLabel()))); $form_state->setRedirectUrl($this->getCancelUrl()); } diff --git a/core/modules/filter/src/Plugin/DataType/FilterFormat.php b/core/modules/filter/src/Plugin/DataType/FilterFormat.php index 31ab7f7..2ba1e3a 100644 --- a/core/modules/filter/src/Plugin/DataType/FilterFormat.php +++ b/core/modules/filter/src/Plugin/DataType/FilterFormat.php @@ -32,7 +32,7 @@ public function getPossibleValues(AccountInterface $account = NULL) { * {@inheritdoc} */ public function getPossibleOptions(AccountInterface $account = NULL) { - return array_map(function ($format) { return $format->label(); }, filter_formats()); + return array_map(function ($format) { return $format->getLabel(); }, filter_formats()); } /** @@ -47,6 +47,6 @@ public function getSettableValues(AccountInterface $account = NULL) { */ public function getSettableOptions(AccountInterface $account = NULL) { // @todo: Avoid calling functions but move to injected dependencies. - return array_map(function ($format) { return $format->label(); }, filter_formats($account)); + return array_map(function ($format) { return $format->getLabel(); }, filter_formats($account)); } } diff --git a/core/modules/filter/src/Tests/FilterDefaultConfigTest.php b/core/modules/filter/src/Tests/FilterDefaultConfigTest.php index 939349a..4adb88d 100644 --- a/core/modules/filter/src/Tests/FilterDefaultConfigTest.php +++ b/core/modules/filter/src/Tests/FilterDefaultConfigTest.php @@ -39,7 +39,7 @@ function testInstallation() { $format = entity_load('filter_format', 'filter_test'); $this->assertTrue((bool) $format); $this->assertEqual($format->id(), 'filter_test'); - $this->assertEqual($format->label(), 'Test format'); + $this->assertEqual($format->getLabel(), 'Test format'); $this->assertEqual($format->getWeight(), 2); // Verify that format default property values have been added/injected.