[TASK] Enhance install tool core update action 65/52265/6
authorOliver Hader <oliver@typo3.org>
Thu, 30 Mar 2017 14:35:21 +0000 (16:35 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 30 Mar 2017 23:18:34 +0000 (01:18 +0200)
A missing typo3_src isn't necessary a warning,
so the warning is not shown during the first install step anymore.
If one doesn't have a linked source, the 'core update' action is disabled.

Change-Id: Ieea48f404f036edf1d75a3cfe41e6074ac1ad6c5
Resolves: #48999
Releases: master
Reviewed-on: https://review.typo3.org/52265
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php
typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php
typo3/sysext/install/Classes/Service/CoreUpdateService.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/CoreUpdateButton.html

index 9eb29dc..f52010a 100644 (file)
@@ -74,9 +74,13 @@ class ImportantActions extends Action\AbstractAction
 
         /** @var \TYPO3\CMS\Install\Service\CoreUpdateService $coreUpdateService */
         $coreUpdateService = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Service\CoreUpdateService::class);
+        /** @var  $coreVersionService \TYPO3\CMS\Install\Service\CoreVersionService */
+        $coreVersionService = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Service\CoreVersionService::class);
         $this->view
             ->assign('enableCoreUpdate', $coreUpdateService->isCoreUpdateEnabled())
             ->assign('composerMode', Bootstrap::usesComposerClassLoading())
+            ->assign('isInstalledVersionAReleasedVersion', $coreVersionService->isInstalledVersionAReleasedVersion())
+            ->assign('isSymLinkedCore', is_link(PATH_site . 'typo3_src'))
             ->assign('operatingSystem', $operatingSystem)
             ->assign('cgiDetected', GeneralUtility::isRunningOnCgiServerApi())
             ->assign('extensionCompatibilityTesterProtocolFile', GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3temp/assets/ExtensionCompatibilityTester.txt')
index f491473..e547652 100644 (file)
@@ -60,10 +60,6 @@ class DefaultFactory
                     'type' => LinkNode::class,
                     'target' => 'typo3_src/typo3',
                 ],
-                [
-                    'name' => 'typo3_src',
-                    'type' => LinkNode::class,
-                ],
             ];
         }
         $structureBase = [
index 04d4cf1..8a05d9d 100644 (file)
@@ -171,7 +171,7 @@ class CoreUpdateService
         $folderStructureFacade = GeneralUtility::makeInstance(DefaultFactory::class)->getStructure();
         $folderStructureErrors = $statusUtility->filterBySeverity($folderStructureFacade->getStatus(), 'error');
         $folderStructureWarnings = $statusUtility->filterBySeverity($folderStructureFacade->getStatus(), 'warning');
-        if (!empty($folderStructureErrors) || !empty($folderStructureWarnings)) {
+        if (!empty($folderStructureErrors) || !empty($folderStructureWarnings) || !is_link(PATH_site . 'typo3_src')) {
             $success = false;
             /** @var $message StatusInterface */
             $message = GeneralUtility::makeInstance(ErrorStatus::class);
index 947ee20..addc931 100644 (file)
@@ -6,7 +6,7 @@
 </p>
 
 <div id="coreUpdate">
-       <f:if condition="{enableCoreUpdate}">
+       <f:if condition="!{composerMode} && {enableCoreUpdate} && {isInstalledVersionAReleasedVersion} && {isSymLinkedCore}">
                <f:then>
                        <div id="buttonTemplate">
                                <fieldset class="t3-install-form-submit">
                                <div class="message-body">
                                        This feature is disabled in this installation.<br />
                                        <f:if condition="{composerMode}">
-                                               <f:then>
-                                                       (Composer Mode is active. Please update using composer commands.)
-                                               </f:then>
-                                               <f:else>
-                                                       (The environment variable was set <code>TYPO3_DISABLE_CORE_UPDATER=1</code>.)
-                                               </f:else>
+                                               Composer Mode is active. Please update using composer commands.
+                                       </f:if>
+                                       <f:if condition="!{enableCoreUpdate}">
+                                               The environment variable was set <code>TYPO3_DISABLE_CORE_UPDATER=1</code>.
+                                       </f:if>
+                                       <f:if condition="!{isInstalledVersionAReleasedVersion}">
+                                               This system isn't a released TYPO3 version.
+                                       </f:if>
+                                       <f:if condition="!{isSymLinkedCore}">
+                                               This action can only be used with a linked typo3_src.
                                        </f:if>
                                </div>
                        </div>