PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | front/Params/lists.php +9 -4 10.0.1 → 11.1.0 View file →
@@ -1,16 +1,20 @@
1 1 <?php
2 +defined('ABSPATH') || die('Restricted Access');
2 3
3 4 use AcyMailing\Classes\ListClass;
4 5
5 6 include_once __DIR__.DIRECTORY_SEPARATOR.'AcymJFormField.php';
6 7
8 +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Joomla specific class naming with imposed prefix "JFormField".
7 9 class JFormFieldLists extends AcymJFormField
8 10 {
9 - var $type = 'lists';
11 + public function __construct($form = null)
12 + {
13 + $this->type = 'lists';
14 + parent::__construct($form);
15 + }
10 16
11 - public $value;
12 -
13 17 public function getInput()
14 18 {
15 19
16 20 $listClass = new ListClass();
@@ -20,9 +24,10 @@
20 24 unset($lists[$i]);
21 25 }
22 26 }
23 27
24 - if (ACYM_CMS == 'joomla' && $this->value == 'All' && !empty($this->form)) {
28 + // In Joomla, when the user chooses to empty a field, it sets the default value of this field... that's not what we want
29 + if (ACYM_CMS == 'joomla' && $this->value === 'All' && !empty($this->form)) {
25 30 $formId = $this->form->getData()->get('id');
26 31 if (!empty($formId)) {
27 32 $this->value = '';
28 33 }