PHP warnings on labels subscription form

Created on 16 July 2025, 14 days ago

Problem/Motivation

When the labels are empty and you visit admin/config/system/mailjet/signup-settings/labels?entity-id=mailjet_subscription_form_379866_902875, you will see these warnings

Warning: Undefined property: Drupal\mailjet_subscription\Entity\SubscriptionForm::$email_label in Drupal\mailjet_subscription\Form\MailjetSubscriptionLabelsForm->buildForm() (line 53 of modules/contrib/mailjet/modules/mailjet_subscription/src/Form/MailjetSubscriptionLabelsForm.php).

Warning: Undefined property: Drupal\mailjet_subscription\Entity\SubscriptionForm::$labels_fields in Drupal\mailjet_subscription\Form\MailjetSubscriptionLabelsForm->buildForm() (line 58 of modules/contrib/mailjet/modules/mailjet_subscription/src/Form/MailjetSubscriptionLabelsForm.php).

Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\mailjet_subscription\Form\MailjetSubscriptionLabelsForm->buildForm() (line 58 of modules/contrib/mailjet/modules/mailjet_subscription/src/Form/MailjetSubscriptionLabelsForm.php).

Steps to reproduce

Enable mailjet and mailjet_subscription module. Add a subscription form, then edit it and click on 'Edit labels'.

Proposed resolution

Add an empty check before accessing an array index or entity property.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇵🇰Pakistan hmdnawaz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024