[BUGFIX] Notification about missing impexp installation 81/29781/4
authorNicole Cordes <typo3@cordes.co>
Fri, 2 May 2014 16:51:32 +0000 (18:51 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 3 May 2014 08:27:02 +0000 (10:27 +0200)
This patch adds a notification to install the impexp extension before
the distribution list is shown.

Resolves: #57375
Releases: 6.2
Change-Id: I04da4afcf9ac43ff99190844fad9582665c0c346
Reviewed-on: https://review.typo3.org/29781
Reviewed-by: Sascha Wilking
Tested-by: Sascha Wilking
Reviewed-by: Jan Runte
Tested-by: Jan Runte
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf
typo3/sysext/extensionmanager/Resources/Private/Templates/List/Distributions.html

index 9d94fa3..7575be0 100644 (file)
@@ -130,6 +130,9 @@ class DownloadController extends AbstractController {
         * @return void
         */
        public function installDistributionAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp')) {
+                       $this->forward('distributions', 'List');
+               }
                list($result, $errorMessage) = $this->installFromTer($extension);
                if ($errorMessage) {
                        // @TODO: write Template
index 4ae0d50..44151d4 100644 (file)
@@ -95,20 +95,24 @@ class ListController extends AbstractController {
         * @return void
         */
        public function distributionsAction() {
-               // check if a TER update has been done at all, if not, fetch it directly
-               /** @var $repositoryHelper \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper */
-               $repositoryHelper = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper');
-               // repository needs an update, but not because of the extension hash has changed
-               if ($repositoryHelper->isExtListUpdateNecessary() > 0 && ($repositoryHelper->isExtListUpdateNecessary() & $repositoryHelper::PROBLEM_EXTENSION_HASH_CHANGED) === 0) {
-                       $repositoryHelper->fetchExtListFile();
-                       $repositoryHelper->updateExtList();
-               }
+               $importExportInstalled = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp');
+               if ($importExportInstalled) {
+                       // check if a TER update has been done at all, if not, fetch it directly
+                       /** @var $repositoryHelper \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper */
+                       $repositoryHelper = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\Repository\\Helper');
+                       // repository needs an update, but not because of the extension hash has changed
+                       if ($repositoryHelper->isExtListUpdateNecessary() > 0 && ($repositoryHelper->isExtListUpdateNecessary() & $repositoryHelper::PROBLEM_EXTENSION_HASH_CHANGED) === 0) {
+                               $repositoryHelper->fetchExtListFile();
+                               $repositoryHelper->updateExtList();
+                       }
 
-               $officialDistributions = $this->extensionRepository->findAllOfficialDistributions();
-               $this->view->assign('officialDistributions', $officialDistributions);
+                       $officialDistributions = $this->extensionRepository->findAllOfficialDistributions();
+                       $this->view->assign('officialDistributions', $officialDistributions);
 
-               $communityDistributions = $this->extensionRepository->findAllCommunityDistributions();
-               $this->view->assign('communityDistributions', $communityDistributions);
+                       $communityDistributions = $this->extensionRepository->findAllCommunityDistributions();
+                       $this->view->assign('communityDistributions', $communityDistributions);
+               }
+               $this->view->assign('enableDistributionsView', $importExportInstalled);
        }
 
        /**
index 3091049..e0b816c 100644 (file)
                        <trans-unit id="extensionList.installDistribution" xml:space="preserve">
                                <source>Install</source>
                        </trans-unit>
+                       <trans-unit id="extensionList.installImpexp" xml:space="preserve">
+                               <source>Please install the Import/Export (impexp) extension to enable distribution support.</source>
+                       </trans-unit>
+                       <trans-unit id="distribution.installImpexp" xml:space="preserve">
+                               <source>Install impexp</source>
+                       </trans-unit>
                        <trans-unit id="extensionList.updateFromTer.label" xml:space="preserve">
                                <source>Retrieving Extension-List from TYPO3 Extension Repository (TER)</source>
                        </trans-unit>
index a224b4c..70bbddd 100644 (file)
 
 <f:section name="Content">
        <f:flashMessages renderMode="div" />
-       <div class="distribution-holder">
-       <f:for each="{officialDistributions}" as="distribution">
-               <f:render partial="List/Distribution" arguments="{distribution: distribution, official: 1}" />
-       </f:for>
-       <f:for each="{communityDistributions}" as="distribution">
-               <f:render partial="List/Distribution" arguments="{distribution: distribution, official: 0}" />
-       </f:for>
-       </div>
+       <f:if condition="{enableDistributionsView}">
+               <f:then>
+                       <div class="distribution-holder">
+                               <f:for each="{officialDistributions}" as="distribution">
+                                       <f:render partial="List/Distribution" arguments="{distribution: distribution, official: 1}" />
+                               </f:for>
+                               <f:for each="{communityDistributions}" as="distribution">
+                                       <f:render partial="List/Distribution" arguments="{distribution: distribution, official: 0}" />
+                               </f:for>
+                       </div>
+               </f:then>
+               <f:else>
+                       <p>{f:translate(key: 'extensionList.installImpexp')}</p>
+                       <f:link.action action="toggleExtensionInstallationState" controller="Action" arguments="{extensionKey: 'impexp'}" class="t3-button t3-button-action-installdistribution">
+                               <span class="t3-icon t3-icon-actions t3-icon-system-extension-import">&nbsp;</span><f:translate key="distribution.installImpexp">Install impexp</f:translate>
+                       </f:link.action>
+               </f:else>
+       </f:if>
 </f:section>
\ No newline at end of file