[BUGFIX] Install tool: Presets with custom im/gm paths 22/53822/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 28 Aug 2017 12:06:21 +0000 (14:06 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Tue, 29 Aug 2017 07:09:12 +0000 (09:09 +0200)
Fix "Find imagemagick / graphicsmagic in specific direcory" input
field in image preset handling.
The preset handling is still a bit ugly and does not integrate
too well into the ajax based handling all other cards use. This
needs a bigger refactoring and is not done with this patch.
For now, submitting a path to the image preset path input field
reloads the view and executes the path test, so the functionality
is there, it's just a bit ugly to use.

Change-Id: I2da1680b44ff34df05aecc4eb589a293bb8d72c2
Resolves: #82188
Related: #76084
Releases: master
Reviewed-on: https://review.typo3.org/53822
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
16 files changed:
typo3/sysext/install/Classes/Controller/Action/Tool/Settings.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Context/Custom.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Context/Debug.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Context/Live.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/ExtbaseObjectCache/Apc.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/ExtbaseObjectCache/Apcu.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/ExtbaseObjectCache/Database.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Image.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Image/Custom.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Image/GraphicsMagick.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Image/ImageMagick6.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Mail/Custom.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Mail/Sendmail.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Settings/Presets/Mail/Smtp.html
typo3/sysext/install/Resources/Public/JavaScript/Modules/Presets.js

index 117adc9..4114873 100644 (file)
@@ -47,7 +47,7 @@ class Settings extends Action\AbstractAction
      */
     protected function executeAction(): string
     {
-        $presetFeatures = $this->featureManager->getInitializedFeatures();
+        $presetFeatures = $this->featureManager->getInitializedFeatures($this->postValues['values'] ?? []);
         $localConfigurationValueService = new LocalConfigurationValueService();
         $formProtection = FormProtectionFactory::get(InstallToolFormProtection::class);
         $this->view->assignMultiple([
index 47f5781..b0f0d15 100644 (file)
        <div id="t3js-presets-activate-token">{presetActivateToken}</div>
 </div>
 
-<div class="form-horizontal">
+<form method="post" class="form-horizontal">
+       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
+
        <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                <f:for each="{presetFeatures}" as="feature">
                        <f:render partial="Action/Tool/Settings/Presets/{feature.name}" arguments="{_all}"/>
                </f:for>
        </div>
-</div>
+</form>
 <div class="t3js-presets-output"></div>
 
 <button
index 479e63b..864d266 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-context-custom"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
@@ -34,7 +34,7 @@
                                                type="text"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control t3js-custom-preset t3js-presets-formField"
+                                               class="form-control t3js-custom-preset"
                                                data-radio="t3-install-tool-configuration-context-custom"
                                        />
                                </div>
index 8bd6053..596fb9e 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-context-debug"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 34e6b49..53a0e04 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-context-live"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 733435f..c2ce156 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-extbaseobjectcache-apc"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 3aff2a4..c59e654 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-extbaseobjectcache-apc"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index dc3b7a8..ed76452 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-extbaseobjectcache-database"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index f254117..feccd4b 100644 (file)
                                                                value="{feature.additionalSearchPath}"
                                                                class="form-control"
                                                />
-                                               <div class="input-group-btn"><button class="btn btn-default" type="submit" name="install[set][ImageSearch]">Find executables in this directory</button></div>
+                                               <div class="input-group-btn">
+                                                       <button class="btn btn-default" type="submit" name="install[set][ImageSearch]">
+                                                               Find executables in this directory
+                                                       </button>
+                                               </div>
                                        </div>
                                </div>
                        </div>
index 0587d1c..0568b03 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-image-custom"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
@@ -34,7 +34,7 @@
                                                type="text"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control t3js-custom-preset t3js-presets-formField"
+                                               class="form-control t3js-custom-preset"
                                                data-radio="t3-install-tool-configuration-image-custom"
                                        />
                                </div>
index 4413cc2..243f0e9 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-image-graphicsmagick"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 8845a91..5062e83 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-image-imagemagick6"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 3e64fb3..b011929 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-mail-custom"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
@@ -31,7 +31,7 @@
                                                type="text"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control t3js-custom-preset t3js-presets-formField"
+                                               class="form-control t3js-custom-preset"
                                                data-radio="t3-install-tool-configuration-mail-custom"
                                                />
                                </div>
index 0999f39..b33776c 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-mail-sendmail"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index cfe63ba..133bf16 100644 (file)
@@ -3,7 +3,7 @@
                <div class="message-header">
                        <input
                                type="radio"
-                               class="t3-install-tool-configuration-radio t3js-presets-formField"
+                               class="t3-install-tool-configuration-radio"
                                id="t3-install-tool-configuration-mail-smtp"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
index 64befb3..cdfd373 100644 (file)
@@ -20,6 +20,7 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
        return {
                selectorActivateToken: '#t3js-presets-activate-token',
                selectorActivateTrigger: '.t3js-presets-activate',
+               selectorContentContainer: '.t3js-presets',
                selectorOutputContainer: '.t3js-presets-output',
 
                initialize: function() {
@@ -38,20 +39,12 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
 
                activate: function() {
                        var url = location.href + '&install[controller]=ajax';
-                       var postData = {
-                               'install[action]': 'presetActivate',
-                               'install[token]': $(this.selectorActivateToken).text()
-                       };
-                       $('.gridder-show .t3js-presets-formField').each(function(i, element) {
-                               var $element = $(element);
-                               if ($element.attr('type') === 'radio') {
-                                       if (element.checked) {
-                                               postData[$element.attr('name')] = $element.val();
-                                       }
-                               } else {
-                                       postData[$element.attr('name')] = $element.val();
-                               }
+                       var postData = {};
+                       $($(this.selectorContentContainer + ' form').serializeArray()).each(function() {
+                               postData[this.name] = this.value;
                        });
+                       postData['install[action]'] = 'presetActivate';
+                       postData['install[token]'] = $(this.selectorActivateToken).text();
                        var $outputContainer = $(this.selectorOutputContainer);
                        var message = ProgressBar.render(Severity.loading, 'Loading...', '');
                        $outputContainer.empty().html(message);