From 57d2b2b3599bac870697492649a6951e002b3d28 Mon Sep 17 00:00:00 2001 From: bjorn <bjorn@swis.nl> Date: Fri, 24 May 2024 15:50:59 +0200 Subject: [PATCH] Issue #3308511 by Mingsong, bbrala: Deprecated function: htmlspecialchars(): Passing null to parameter #1 --- src/Form/JsonapiResourceConfigForm.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Form/JsonapiResourceConfigForm.php b/src/Form/JsonapiResourceConfigForm.php index b9e5f47..e3d679a 100644 --- a/src/Form/JsonapiResourceConfigForm.php +++ b/src/Form/JsonapiResourceConfigForm.php @@ -203,17 +203,18 @@ class JsonapiResourceConfigForm extends EntityForm { public function save(array $form, FormStateInterface $form_state) { $resource_config = $this->entity; $status = $resource_config->save(); + $type = $resource_config->get('resourceType') ?? ''; switch ($status) { case SAVED_NEW: - $this->messenger()->addStatus($this->t('Created the %label JSON:API Resource overwrites.', [ - '%label' => $resource_config->id(), + $this->messenger()->addStatus($this->t('Created the %type JSON:API Resource overwrites.', [ + '%type' => $type, ])); break; default: - $this->messenger()->addStatus($this->t('Saved the %label JSON:API Resource overwrites.', [ - '%label' => $resource_config->id(), + $this->messenger()->addStatus($this->t('Saved the %type JSON:API Resource overwrites.', [ + '%type' => $type, ])); } $form_state->setRedirectUrl($resource_config->toUrl('collection')); -- GitLab