Skip to content

Commit 79052fd

Browse files
committed
Merge branch 'release/8.2.3'
2 parents ca32b73 + 48096e1 commit 79052fd

File tree

9 files changed

+36
-52
lines changed

9 files changed

+36
-52
lines changed

Classes/Domain/Factory/MailFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function setFeuser(Mail $mail): void
7272
$userRepository = ObjectUtility::getObjectManager()->get(UserRepository::class);
7373
$feUserUid = FrontendUtility::getPropertyFromLoggedInFrontendUser('uid');
7474
$user = $userRepository->findByUid($feUserUid);
75-
if ($user instanceof User) {
75+
if ($user !== null) {
7676
$mail->setFeuser($user);
7777
}
7878
}

Classes/Domain/Repository/MailRepository.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ public function findByUid($uid)
131131
* @param Form $form
132132
* @param int $pageUid
133133
* @return QueryResultInterface
134-
* @throws Exception
135-
* @throws InvalidQueryExceptionAlias
136-
* @throws ExtensionConfigurationExtensionNotConfiguredException
137-
* @throws ExtensionConfigurationPathDoesNotExistException
138134
*/
139135
public function findByMarkerValueForm(string $marker, string $value, Form $form, int $pageUid): QueryResultInterface
140136
{

Classes/Domain/Validator/UniqueValidator.php

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,44 @@
77
use In2code\Powermail\Domain\Repository\MailRepository;
88
use In2code\Powermail\Utility\FrontendUtility;
99
use In2code\Powermail\Utility\ObjectUtility;
10-
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
11-
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
1210
use TYPO3\CMS\Extbase\Object\Exception;
13-
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
1411

1512
/**
1613
* Class UniqueValidator
14+
* @noinspection PhpUnused
1715
*/
1816
class UniqueValidator extends AbstractValidator
1917
{
20-
2118
/**
22-
* Validation of given Params
23-
*
2419
* @param Mail $mail
2520
* @return bool
2621
* @throws Exception
27-
* @throws ExtensionConfigurationExtensionNotConfiguredException
28-
* @throws ExtensionConfigurationPathDoesNotExistException
29-
* @throws InvalidQueryException
3022
*/
3123
public function isValid($mail)
3224
{
33-
if (empty($this->settings['validation']['unique'])) {
34-
return $this->isValidState();
35-
}
36-
foreach ($this->settings['validation']['unique'] as $marker => $amount) {
37-
if ((int)$amount === 0) {
38-
continue;
39-
}
40-
foreach ($mail->getAnswers() as $answer) {
41-
/** @var Answer $answer */
42-
if ($answer->getField()->getMarker() === $marker) {
43-
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
44-
$numberOfMails = $mailRepository->findByMarkerValueForm(
45-
$marker,
46-
$answer->getValue(),
47-
$mail->getForm(),
48-
FrontendUtility::getStoragePage($this->getStoragePid())
49-
)->count();
25+
if (!empty($this->settings['validation']['unique'])) {
26+
foreach ($this->settings['validation']['unique'] as $marker => $amount) {
27+
if ($amount > 0) {
28+
foreach ($mail->getAnswers() as $answer) {
29+
/** @var Answer $answer */
30+
if ($answer->getField()->getMarker() === $marker) {
31+
/** @var MailRepository $mailRepository */
32+
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
33+
$numberOfMails = $mailRepository->findByMarkerValueForm(
34+
$marker,
35+
$answer->getValue(),
36+
$mail->getForm(),
37+
FrontendUtility::getStoragePage($this->getStoragePid())
38+
)->count();
5039

51-
if ($amount <= $numberOfMails) {
52-
$this->setErrorAndMessage($answer->getField(), 'unique');
40+
if ($amount <= $numberOfMails) {
41+
$this->setErrorAndMessage($answer->getField(), 'unique');
42+
}
43+
}
5344
}
5445
}
5546
}
5647
}
57-
5848
return $this->isValidState();
5949
}
6050

Classes/Hook/PluginPreview.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,8 @@ protected function getReceiverEmail(): string
158158
protected function getFormTitleByUid(int $uid): string
159159
{
160160
$uid = $this->getLocalizedFormUid($uid, $this->getSysLanguageUid());
161-
$row = BackendUtilityCore::getRecord(
162-
Form::TABLE_NAME,
163-
$uid,
164-
'title',
165-
'',
166-
false
167-
);
168-
return $row['title'];
161+
$row = BackendUtilityCore::getRecord(Form::TABLE_NAME, $uid, 'title', '', false);
162+
return (string)$row['title'];
169163
}
170164

171165
/**

Documentation/Changelog/Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
| Version | Release Date | Description |
66
|------------ |--------------|-----------------------------------------------------------------------------------------------------------------------|
7+
| 8.2.3 | 2020-11-08 | Bugfix: Set tx_powermail_domain_model_mail.fe_user value for logged in users |
8+
| | | Bugfix: Fix link from PluginPreview to powermail module |
9+
| | | Bugfix: Prevent possible exception if not existing form is selected in a plugin (e.g. from old data garbage) |
10+
| | | Bugfix: Re-add english mail label for backend list view |
11+
| | | Task: Small code cleanup |
12+
| | | Task: Small documentation update |
713
| 8.2.2 | 2020-10-21 | Bugfix: Fix false positive error message in frontend "TypoScript is missing" together with marketing information |
814
| | | Bugfix: Fix a possible type hint error logs when no referrer is available |
915
| | | Bugfix: Fix a possible type hint exception if TSFE is not available |

Documentation/ForDevelopers/AddNewFields.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ With this TSConfig a new Option is available:
3030
![developer_new_fields2](../Images/developer_new_fields2.png)
3131

3232
If an editor chose the new field, powermail searches by default for a Partial with Name New.html
33-
(Default Path is powermail/Resources/Private/Partials/Form/New.html).
33+
(Default Path is powermail/Resources/Private/Partials/Form/Field/New.html).
3434

3535
Because you should not modify anything within an extension-folder (because of upcoming extension-updates),
36-
you should create a new file in your fileadmin folder - e.g.: fileadmin/powermail/Partials/Form/New.html
36+
you should create a new file in your fileadmin folder - e.g.: fileadmin/powermail/Partials/Form/Field/New.html
3737

3838
### Example Content:
3939

Resources/Private/Language/locallang_db.xlf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<trans-unit id="tabs.access" resname="tabs.access">
77
<source>Access</source>
88
</trans-unit>
9+
<trans-unit id="tx_powermail_domain_model_mail">
10+
<source>Mails</source>
11+
</trans-unit>
912
<trans-unit id="tx_powermail_domain_model_mail.palette1" resname="tx_powermail_domain_model_mail.palette1">
1013
<source>Sender</source>
1114
</trans-unit>

Resources/Private/Templates/Hook/PluginPreview.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,10 @@ <h3><f:translate key="LLL:EXT:powermail/Resources/Private/Language/locallang_db.
163163
<f:if condition="{index.isLast}">
164164
<tr>
165165
<td colspan="4" style="padding: 2px 10px 2px 5px">
166-
<f:link.action
167-
action="list"
168-
controller="Module"
169-
extensionName="Powermail"
170-
additionalParams="{M:'web_PowermailM1',id:mail.pid}"
171-
pluginName="web_powermailm1">
166+
<f:be.link route="web_PowermailM1" parameters="{id:mail.pid}">
172167
<f:translate key="LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:pluginInfo.more">more ...</f:translate>
173168
<core:Icon identifier="actions-search" />
174-
</f:link.action>
169+
</f:be.link>
175170
</td>
176171
</tr>
177172
</f:if>

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' => '8.2.2',
12+
'version' => '8.2.3',
1313
'state' => 'stable',
1414
'author' => 'Powermail Development Team',
1515
'author_email' => 'alexander.kellner@in2code.de',

0 commit comments

Comments
 (0)