Skip to content

Commit 9dca732

Browse files
committed
Bug-fix.
Changelog excerpt: - The reset button at the front-end configuration page wasn't resetting the hidden "other" field; Fixed.
1 parent 52ce558 commit 9dca732

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
119119
[2022.10.28; Maikuolan]: Reworked how the configuration page deals with volume-based configuration.
120120

121121
[2022.11.20; Maikuolan]: Avoid packaging unnecessary files into dist.
122+
123+
### v3.3.1
124+
125+
[2022.12.10; Bug-fix; Maikuolan]: The reset button at the front-end configuration page wasn't resetting the hidden "other" field; Fixed.

src/FrontEnd.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Front-end handler (last modified: 2022.10.28).
11+
* This file: Front-end handler (last modified: 2022.12.10).
1212
*/
1313

1414
namespace phpMussel\FrontEnd;
@@ -1577,6 +1577,13 @@ public function view(string $Page = ''): void
15771577

15781578
/** Reset to defaults. */
15791579
if ($ThisDir['Reset'] !== '') {
1580+
if (isset($DirValue['preview'], $DirValue['default']) && $DirValue['preview'] === 'allow_other') {
1581+
$ThisDir['Reset'] .= sprintf(
1582+
'hideid(\'%1$s_field\');getElementById(\'%1$s_field\').value=\'%2$s\';',
1583+
$ThisDir['DirLangKeyOther'],
1584+
$DirValue['default']
1585+
);
1586+
}
15801587
$ThisDir['FieldOut'] .= sprintf(
15811588
'<br /><br /><input type="button" class="reset" onclick="javascript:%s" value="↺ %s" />',
15821589
$ThisDir['Reset'],

0 commit comments

Comments
 (0)