Skip to content
Snippets Groups Projects
Commit 3a79a7b4 authored by Brett Hoffman's avatar Brett Hoffman Committed by Brett Hoffman
Browse files

Issue #3132001 by hoffismo: SmartIpLanguageMapping::save function is returning a void

parent a491e057
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,7 @@ class SmartIpLanguageMapping extends ConfigEntityBase {
$this->label = $this->country;
$this->id = 'smartip_language_mapping_' . strtolower($this->country);
parent::save();
return parent::save();
}
}
......@@ -4,8 +4,8 @@ namespace Drupal\smartip_language_detection\Form;
use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Url;
/**
* Builds the form to delete Smart IP language mapping entities.
......@@ -18,7 +18,7 @@ class SmartIpLanguageMappingDeleteForm extends EntityConfirmFormBase {
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to delete %label mapping?', ['%label' => $this->entity->getCountryName()]);
return $this->t('Are you sure you want to delete the %label mapping?', ['%label' => $this->entity->getCountryName()]);
}
/**
......@@ -43,9 +43,9 @@ class SmartIpLanguageMappingDeleteForm extends EntityConfirmFormBase {
$entity = $this->entity;
$entity->delete();
$this->messenger()->addMessage(
$this->t('Deleted the %label mapping.', ['%label' => $entity->getCountryName()])
);
$this->messenger()->addMessage($this->t('Deleted the %label mapping.', [
'%label' => $entity->getCountryName(),
]));
$form_state->setRedirectUrl($this->getCancelUrl());
}
......
......@@ -5,8 +5,8 @@ namespace Drupal\smartip_language_detection\Form;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\smartip_language_detection\Entity\SmartIpLanguageMapping;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\smartip_language_detection\Entity\SmartIpLanguageMapping;
/**
* Class SmartIpLanguageMappingForm.
......@@ -81,10 +81,11 @@ class SmartIpLanguageMappingForm extends EntityForm {
break;
default:
$this->messenger()->addMessage($this->t('Saved the %label mapping.', [
$this->messenger()->addMessage($this->t('Updated the %label mapping.', [
'%label' => $entity->getCountryName(),
]));
}
$form_state->setRedirectUrl($entity->toUrl('collection'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment