Skip to content

Commit 497dfc4

Browse files
committed
Merge branch 'release/10.4.1'
2 parents 5c09eff + 6c92d9c commit 497dfc4

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Classes/Hook/CreateMarker.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtilityCore;
1212
use TYPO3\CMS\Core\Utility\GeneralUtility;
1313
use TYPO3\CMS\Extbase\Object\Exception;
14+
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
1415

1516
/**
1617
* Class CreateMarker to autofill field marker with value from title e.g. {firstname}
@@ -207,7 +208,7 @@ protected function addExistingFields(): void
207208
{
208209
$fieldProperties = $this->getFieldProperties();
209210
foreach ($fieldProperties as $properties) {
210-
$this->addField($this->makeFieldFromProperties($properties));
211+
$this->addField($this->getFieldObjectFromProperties($properties));
211212
}
212213
}
213214

@@ -220,7 +221,7 @@ protected function addExistingFields(): void
220221
protected function addNewFields(): void
221222
{
222223
foreach ((array)($this->data[Field::TABLE_NAME] ?? []) as $fieldUid => $properties) {
223-
$this->addField($this->makeFieldFromProperties($properties, (string)$fieldUid));
224+
$this->addField($this->getFieldObjectFromProperties($properties, (string)$fieldUid));
224225
}
225226
}
226227

@@ -235,14 +236,15 @@ protected function addNewFields(): void
235236
* @param string $uid Number for persisted and string for new fields like "NEW5e2d7c8f48f4a868804329"
236237
* @return Field
237238
*/
238-
protected function makeFieldFromProperties(array $properties, string $uid = '0')
239+
protected function getFieldObjectFromProperties(array $properties, string $uid = '0'): Field
239240
{
240-
$field = GeneralUtility::makeInstance(Field::class);
241-
foreach ($properties as $key => $value) {
242-
$field->_setProperty(GeneralUtility::underscoredToLowerCamelCase($key), $value);
241+
$dataMapper = GeneralUtility::makeInstance(DataMapper::class);
242+
if (isset($properties['uid']) === false) {
243+
$properties['uid'] = null;
243244
}
245+
$field = $dataMapper->map(Field::class, [$properties])[0];
244246
if (!empty($properties['sys_language_uid'])) {
245-
$field->_setProperty('_languageUid', $properties['sys_language_uid']);
247+
$field->_setProperty('_languageUid', (int)$properties['sys_language_uid']);
246248
}
247249
$field->setDescription((string)($properties['uid'] ?? '') > 0 ? (string)$properties['uid'] : $uid);
248250
return $field;

Documentation/Changelog/Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ breaking changes and how to handle them
77

88
| Version | Release Date | Description |
99
|--------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
10+
| 10.4.1 | 2022-06-26 | Respect class property types when creating fields in backend |
1011
| 10.4.0 | 2022-06-16 | Reduce technical debt for easier upgrade for upcoming TYPO3 versions, fix file upload with confirmation page, small code cleanup |
1112
| 10.3.3 | 2022-06-13 | Bugfix of undefined array key in PHP 8 (in FinisherRunner) |
1213
| 10.3.2 | 2022-06-08 | Fix regression that prevented redirects after submit, Fix JS validation with reset buttons |
@@ -15,7 +16,7 @@ breaking changes and how to handle them
1516
| 10.2.0 | 2022-05-25 | Fix some tests, XLS export should be opened in a new window, fix some undefined array keys |
1617
| 10.1.0 | 2022-04-13 | Feature: New form validation: Add callbacks on form submits with errors, scroll to error field on submit |
1718
| 10.0.0 (!!!) | 2022-04-10 | Feature: Remove jQuery, parsley.js and other old JS frameworks and replace it |
18-
| 9.0.0 (!!!) | 2022-11-11 | Feature: Add Support TYPO3 11, drop support for TYPO3 10 |
19+
| 9.0.0 (!!!) | 2021-11-11 | Feature: Add Support TYPO3 11, drop support for TYPO3 10 |
1920
| | | Feature: Allow to disable ip-api.com (Stefan Busemann) |
2021
| | | Feature: Provide local dev environment (Marcus Schwemer) |
2122
| | | Feature: Make screenshots on acceptance test failure (Marcus Schwemer) |

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
and easy to use mailform extension with a lots of features
1010
(spam prevention, marketing information, optin, ajax submit, diagram analysis, etc...)',
1111
'category' => 'plugin',
12-
'version' => '10.4.0',
12+
'version' => '10.4.1',
1313
'state' => 'stable',
1414
'author' => 'Powermail Development Team',
1515
'author_email' => 'service@in2code.de',

0 commit comments

Comments
 (0)