From a0e4a8c6c7e248396d478c45417dcaebcb71ac3e Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 20 Aug 2024 01:25:37 +0200 Subject: [PATCH] patched mailjet settings form (us_states include) --- composer.json | 3 +- ...ljet_settingsform_usstates_commented.patch | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 patches/mailjet_settingsform_usstates_commented.patch diff --git a/composer.json b/composer.json index 7e68d8e5..57a2ce2f 100644 --- a/composer.json +++ b/composer.json @@ -294,7 +294,8 @@ "undefined index name 16 https://www.drupal.org/project/field_group/issues/3064890" : "https://www.drupal.org/files/issues/2020-08-10/field_group-undefined-index-name-3064890-16.patch" }, "drupal/mailjet": { - "https://www.drupal.org/project/mailjet/issues/3325412":"https://www.drupal.org/files/issues/2022-12-05/mailjet-list_instead_of_listid.patch" + "https://www.drupal.org/project/mailjet/issues/3325412":"https://www.drupal.org/files/issues/2022-12-05/mailjet-list_instead_of_listid.patch", + "mailjet settings form bug with us_states include":"./patches/mailjet_settingsform_usstates_commented.patch" }, "drupal/term_reference_tree": { "Term Reference Tree: Re-implement Track List https://www.drupal.org/project/term_reference_tree/issues/3064280": "https://www.drupal.org/files/issues/2022-02-07/3064280_bring_back_tracklist-16.patch" diff --git a/patches/mailjet_settingsform_usstates_commented.patch b/patches/mailjet_settingsform_usstates_commented.patch new file mode 100644 index 00000000..f2b3c29f --- /dev/null +++ b/patches/mailjet_settingsform_usstates_commented.patch @@ -0,0 +1,41 @@ +diff --git a/src/Form/MailjetSettingsForm.php b/src/Form/MailjetSettingsForm.php +index 553de57..0a7b778 100644 +--- a/src/Form/MailjetSettingsForm.php ++++ b/src/Form/MailjetSettingsForm.php +@@ -231,21 +231,21 @@ public function buildForm(array $form, FormStateInterface $form_state) + + // States only show up for US citizens + +- $path = drupal_get_path('module', 'mailjet'); +- //include $path . '/lib/mailjet-api-php/src/UsStates.php'; +- $form['infos']['address_state'] = [ +- '#type' => 'select', +- '#title' => t('State'), +- '#options' => UsStates::getStates(), +- '#default_value' => !empty($user_infos) ? $user_infos['AddressState'] : '', +- '#required' => true, +- '#states' => [ +- // Only show this field when the value of type is sell. +- 'visible' => [ +- ':input[name="address_country"]' => ['value' => 'US'], +- ], +- ], +- ]; ++ // $path = drupal_get_path('module', 'mailjet'); ++ // //include $path . '/lib/mailjet-api-php/src/UsStates.php'; ++ // $form['infos']['address_state'] = [ ++ // '#type' => 'select', ++ // '#title' => t('State'), ++ // '#options' => UsStates::getStates(), ++ // '#default_value' => !empty($user_infos) ? $user_infos['AddressState'] : '', ++ // '#required' => true, ++ // '#states' => [ ++ // // Only show this field when the value of type is sell. ++ // 'visible' => [ ++ // ':input[name="address_country"]' => ['value' => 'US'], ++ // ], ++ // ], ++ // ]; + + $form['actions']['#type'] = 'actions'; + $form['actions']['submit'] = [