From 0e408c3eaa1f0334bfffde07ab025f7e4c942aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ruz=CC=8Cevic=CC=81?= Date: Fri, 11 Nov 2022 13:37:19 +0100 Subject: [PATCH] fixing issue with the hidden field and legacy items in the settings --- CHANGELOG.md | 9 +++++++++ eightshift-forms.php | 2 +- package.json | 2 +- src/Integrations/Mailerlite/MailerliteClient.php | 2 +- src/Settings/SettingsHelper.php | 7 ++++++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f77b0334..1106e4dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [2.1.0] + +### Fixed +- Issue with the hidden field and legacy items in the integration settings. + +### Changed +- MailerLite default status to active + ## [2.0.1] ### Fixed @@ -142,6 +150,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Initial production release. +[2.1.0]: https://github.com/infinum/eightshift-forms/compare/2.0.1...2.1.0 [2.0.1]: https://github.com/infinum/eightshift-forms/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/infinum/eightshift-forms/compare/1.4.0...2.0.0 [1.4.0]: https://github.com/infinum/eightshift-forms/compare/1.3.0...1.4.0 diff --git a/eightshift-forms.php b/eightshift-forms.php index 51b82e72..a5da194d 100644 --- a/eightshift-forms.php +++ b/eightshift-forms.php @@ -6,7 +6,7 @@ * Description: Eightshift form builder plugin. * Author: Team Eightshift * Author URI: https://eightshift.com/ - * Version: 2.0.0 + * Version: 2.1.0 * Text Domain: eightshift-forms * * @package EightshiftForms diff --git a/package.json b/package.json index 7fa3ad6f..06507e3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eightshift/eightshift-forms", - "version": "2.0.1", + "version": "2.1.0", "description": "This repository contains all the tools you need to start building a modern WordPress project.", "authors": [ { diff --git a/src/Integrations/Mailerlite/MailerliteClient.php b/src/Integrations/Mailerlite/MailerliteClient.php index 6f04c7af..1436eec1 100644 --- a/src/Integrations/Mailerlite/MailerliteClient.php +++ b/src/Integrations/Mailerlite/MailerliteClient.php @@ -133,7 +133,7 @@ public function postApplication(string $itemId, array $params, array $files, str 'email' => $email, 'resubscribe' => true, 'autoresponders' => true, - 'type' => 'unconfirmed', + 'type' => 'active', 'fields' => $this->prepareParams($params), ]; diff --git a/src/Settings/SettingsHelper.php b/src/Settings/SettingsHelper.php index a086b51e..19db93ad 100644 --- a/src/Settings/SettingsHelper.php +++ b/src/Settings/SettingsHelper.php @@ -500,6 +500,9 @@ public function getIntegrationFieldsValue(array $dbSettingsValue, array $formFie // Find field id. $id = $value["{$component}Id"] ?? ''; + // Find field type. + $fieldType = $value["{$component}Type"] ?? ''; + // Find field label. $label = $value["{$component}FieldLabel"] ?? ''; @@ -538,7 +541,9 @@ static function ($item) use ($itemValue) { $formFields[$key]["{$component}FieldOrder"] = $itemValue; break; case $this->integrationFieldUse: - $formFields[$key]["{$component}FieldUse"] = \filter_var($itemValue, \FILTER_VALIDATE_BOOLEAN); + if ($fieldType !== 'hidden') { + $formFields[$key]["{$component}FieldUse"] = \filter_var($itemValue, \FILTER_VALIDATE_BOOLEAN); + } break; case $this->integrationFieldFileInfoLabel: if ($itemValue === 'true') {