| @@ -1,10 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | +defined('ABSPATH') || die('Restricted Access'); | |
| 2 | 3 | |
| 3 | 4 | use AcyMailing\Classes\FieldClass; |
| 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 JFormFieldFields extends AcymJFormField |
| 8 | 10 | { |
| 9 | 11 | public function __construct($form = null) |
| 10 | 12 | { |
| @@ -22,8 +24,9 @@ | ||
| 22 | 24 | $fields[$field->id] = acym_translation($field->name); |
| 23 | 25 | } |
| 24 | 26 | |
| 25 | 27 | |
| 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 | |
| 26 | 29 | if (ACYM_CMS == 'joomla' && $this->value == '1') { |
| 27 | 30 | $formId = $this->form->getData()->get('id'); |
| 28 | 31 | if (!empty($formId)) { |
| 29 | 32 | $this->value = ''; |