Skip to content

Commit 285625f

Browse files
committed
Merge branch 'release/8.3.2'
2 parents 9b03907 + 409b7ad commit 285625f

File tree

18 files changed

+48
-42
lines changed

18 files changed

+48
-42
lines changed

Classes/Controller/FormController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ protected function forwardIfMailParamEmpty(): void
430430
$arguments = $this->request->getArguments();
431431
if (empty($arguments['mail'])) {
432432
$logger = ObjectUtility::getLogger(__CLASS__);
433-
$logger->alert('Redirect (mail empty)', $arguments);
433+
$logger->warning('Redirect (mail empty)', $arguments);
434434
$this->forward('form');
435435
}
436436
}
@@ -449,7 +449,7 @@ protected function forwardIfFormParamsDoNotMatchForOptinConfirm(Mail $mail = nul
449449
$formsToContent = GeneralUtility::intExplode(',', $this->settings['main']['form']);
450450
if (!in_array($mail->getForm()->getUid(), $formsToContent)) {
451451
$logger = ObjectUtility::getLogger(__CLASS__);
452-
$logger->alert('Redirect (optin)', [$formsToContent, (array)$mail]);
452+
$logger->warning('Redirect (optin)', [$formsToContent, (array)$mail]);
453453
$this->forward('form');
454454
}
455455
}

Classes/Domain/Service/UploadService.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ protected function makeUniqueFilenames(): void
260260
if (!$file->isUploaded()) {
261261
$fileName = $file->getNewName();
262262
if ($this->isRandomizeFileNameConfigured()) {
263-
$fileName = $this->randomizeFileName($file->getNewName());
263+
$fileName = $this->randomizeFileName($file->getNewName(), $this->isPrependOriginalFileNameConfigured());
264264
$file->renameName($fileName);
265265
}
266266
for ($i = 1; $this->isNotUniqueFilename($file); $i++) {
@@ -307,13 +307,20 @@ protected function isFileExistingInUploadFolder(File $file): bool
307307
}
308308

309309
/**
310-
* @param string $filename
310+
* @param $filename
311+
* @param false $prependOriginalFileName
311312
* @return string
312313
*/
313-
protected function randomizeFileName(string $filename): string
314+
protected function randomizeFileName($filename, $prependOriginalFileName = false): string
314315
{
315316
$fileInfo = pathinfo($filename);
316-
return StringUtility::getRandomString(32, false) . '.' . $fileInfo['extension'];
317+
$randomizedFileName = '';
318+
if ($prependOriginalFileName) {
319+
$randomizedFileName .= $fileInfo['filename'] . '-';
320+
}
321+
$randomizedFileName .= StringUtility::getRandomString(32, false);
322+
$randomizedFileName .= '.' . $fileInfo['extension'];
323+
return $randomizedFileName;
317324
}
318325

319326
/**
@@ -355,6 +362,14 @@ protected function isRandomizeFileNameConfigured(): bool
355362
return $this->settings['misc']['file']['randomizeFileName'] === '1';
356363
}
357364

365+
/**
366+
* @return bool
367+
*/
368+
protected function isPrependOriginalFileNameConfigured(): bool
369+
{
370+
return $this->settings['misc']['file']['randomizePrependOriginalFileName'] === '1';
371+
}
372+
358373
/**
359374
* @return string
360375
*/

Classes/Finisher/SendParametersFinisher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function writeToDevelopmentLog(): void
7979
{
8080
if ($this->configuration['debug']) {
8181
$logger = ObjectUtility::getLogger(__CLASS__);
82-
$logger->alert('SendPost Values', $this->getCurlSettings());
82+
$logger->info('SendPost Values', $this->getCurlSettings());
8383
}
8484
}
8585

Classes/Utility/TypoScriptUtility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ class TypoScriptUtility
1616
* Overwrite a string if a TypoScript cObject is available
1717
*
1818
* @param string $string Value to overwrite
19-
* @param array $conf TypoScript Configuration Array
19+
* @param array|null $conf TypoScript Configuration Array
2020
* @param string $key Key for TypoScript Configuration
2121
* @return string
2222
* @codeCoverageIgnore
2323
* @throws Exception
2424
*/
2525
public static function overwriteValueFromTypoScript(
2626
string $string = '',
27-
array $conf = [],
27+
?array $conf = [],
2828
string $key = ''
2929
): string {
3030
if (ObjectUtility::getContentObject()->cObjGetSingle($conf[$key], $conf[$key . '.'])) {

Configuration/TypoScript/Main/constants.typoscript

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ plugin.tx_powermail {
219219
# cat=powermail_additional//0840; type=boolean; label= Randomized Filenames: Uploaded filenames can be randomized to respect data privacy
220220
randomizeFileName = 1
221221

222-
# cat=powermail_additional//0845; type=boolean; label= Force JavaScript Datepicker: Per default html5 Date or Datetime format is used. If you don't want to use it and want to have the same datepicker all over all browsers, you can enable this feature
222+
# cat=powermail_additional//0840; type=boolean; label= Prepend original file name: Prepend original file name to randomized file name if randomizeFileName is enabled
223+
randomizePrependOriginalFileName = 0
224+
225+
# cat=powermail_additional//0845; type=boolean; label= Force JavaScript Datepicker: Per default html5 Date or Datetime format is used. If you don't want to use it and want to have the same datepicker all over all browsers, you can enable this feature
223226
forceJavaScriptDatePicker = 0
224227

225228
# cat=powermail_additional//0850; type=boolean; label= Debug Settings: Show all Settings from TypoScript, Flexform and Global Config in Devlog

Configuration/TypoScript/Main/setup.typoscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ plugin.tx_powermail {
543543
size = {$plugin.tx_powermail.settings.misc.uploadSize}
544544
extension = {$plugin.tx_powermail.settings.misc.uploadFileExtensions}
545545
randomizeFileName = {$plugin.tx_powermail.settings.misc.randomizeFileName}
546+
randomizePrependOriginalFileName = {$plugin.tx_powermail.settings.misc.randomizePrependOriginalFileName}
546547
}
547548

548549
datepicker {

Configuration/TypoScript/Powermail_Frontend/setup.typoscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ plugin.tx_powermail {
3333
size = {$plugin.tx_powermail.settings.misc.uploadSize}
3434
extension = {$plugin.tx_powermail.settings.misc.uploadFileExtensions}
3535
randomizeFileName = {$plugin.tx_powermail.settings.misc.randomizeFileName}
36+
randomizePrependOriginalFileName = {$plugin.tx_powermail.settings.misc.randomizePrependOriginalFileName}
3637
}
3738
}
3839

Documentation/Changelog/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| Version | Release Date | Description |
66
|------------ |--------------|-----------------------------------------------------------------------------------------------------------------------|
7+
| 8.3.2 | 2021-04-30 | Bugfix: Fix typehint error with overwriteValueFromTypoScript() |
78
| 8.3.1 | 2021-03-08 | Bugfix: Don't validate captcha fields of already persisted mails (in double optin) |
89
| 8.3.0 | 2021-02-16 | Feature: Add autodeployment functionality to TER |
910
| | | Bugfix: Foreign-Validator compatibility to core methods |

Documentation/ForAdministrators/BestPractice/MainTypoScript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ plugin.tx_powermail {
231231
# cat=powermail_additional//0840; type=boolean; label= Randomized Filenames: Uploaded filenames can be randomized to respect data privacy
232232
randomizeFileName = 1
233233
234+
# cat=powermail_additional//0840; type=boolean; label= Prepend original file name: Prepend original file name to randomized file name if randomizeFileName is enabled
235+
randomizePrependOriginalFileName = 0
236+
234237
# cat=powermail_additional//0845; type=boolean; label= Force JavaScript Datepicker: Per default html5 Date or Datetime format is used. If you don't want to use it and want to have the same datepicker all over all browsers, you can enable this feature
235238
forceJavaScriptDatePicker = 0
236239
@@ -903,6 +906,7 @@ plugin.tx_powermail {
903906
size = {$plugin.tx_powermail.settings.misc.uploadSize}
904907
extension = {$plugin.tx_powermail.settings.misc.uploadFileExtensions}
905908
randomizeFileName = {$plugin.tx_powermail.settings.misc.randomizeFileName}
909+
randomizePrependOriginalFileName = {$plugin.tx_powermail.settings.misc.randomizePrependOriginalFileName}
906910
}
907911
908912
datepicker {

Documentation/ForAdministrators/PowermailFrontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ values again.
1818
|-------|-------------|-------------|-----|
1919
| Choose your view | Choose a view | List or Detail, Edit, All Views | Main Settings |
2020
| Choose a form | Choose an existing form | Select a Form and click save | Main Settings |
21-
| Select a page with mails | Select a page with mails (optionsl) | Only mails which are stored in the given page are shown in the frontent (optional setting). | Main Settings |
21+
| Select a page with mails | Select a page with mails (optionsl) | Only mails which are stored in the given page are shown in the frontend (optional setting). | Main Settings |
2222
| Choose Fields | Choose Fields (Empty: All Fields) | Let the selection empty if you want to see all form values. | Listview |
2323
| Export Formats | Add links to different export methods by adding some. | XLS, CSV or RSS feed is possible in powermail_frontend. | Listview |
2424
| Show entries... | If you want to show only mails within a timeperiod, add some seconds. | If you want to show the mails of the last 24h add “86400”. Let this field empty to disable this function. | Listview |

0 commit comments

Comments
 (0)