[BUGFIX] Fix context parameter in Database Analyzer URL 79/36179/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 22 Jan 2015 16:50:54 +0000 (17:50 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 25 Jan 2015 19:13:13 +0000 (20:13 +0100)
The variable {context} cannot get resolved because the output is not
rendered by Fluid. The variable gets replaced by the context string.

Resolves: #64441
Releases: master, 6.2
Change-Id: I5beacf301dbf89428e696d94227b341fb7a22e4c
Reviewed-on: http://review.typo3.org/36179
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/Updates/AbstractDatabaseSchemaUpdate.php
typo3/sysext/install/Classes/Updates/FinalDatabaseSchemaUpdate.php

index 8f72df2..547d148 100644 (file)
@@ -37,12 +37,17 @@ abstract class AbstractDatabaseSchemaUpdate extends AbstractUpdate {
        protected $expectedSchemaService;
 
        /**
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        */
+       protected $objectManager;
+
+       /**
         * Constructor function.
         */
        public function __construct() {
-               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-               $this->schemaMigrationService = $objectManager->get(\TYPO3\CMS\Install\Service\SqlSchemaMigrationService::class);
-               $this->expectedSchemaService = $objectManager->get(\TYPO3\CMS\Install\Service\SqlExpectedSchemaService::class);
+               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
+               $this->schemaMigrationService = $this->objectManager->get(\TYPO3\CMS\Install\Service\SqlSchemaMigrationService::class);
+               $this->expectedSchemaService = $this->objectManager->get(\TYPO3\CMS\Install\Service\SqlExpectedSchemaService::class);
        }
 
        /**
index 61ea1b4..182c788 100644 (file)
@@ -36,9 +36,10 @@ class FinalDatabaseSchemaUpdate extends AbstractDatabaseSchemaUpdate {
         * @return bool TRUE if an update is needed, FALSE otherwise
         */
        public function checkForUpdate(&$description) {
+               $contextService = $this->objectManager->get(\TYPO3\CMS\Install\Service\ContextService::class);
                $description = 'There are tables or fields in the database which need to be changed.<br /><br />' .
                'This update wizard can be run only when there are no other update wizards left to make sure they have all needed fields unchanged.<br /><br />' .
-               'If you want to apply changes selectively, <a href="Install.php?install[action]=importantActions&amp;install[context]={context}&amp;install[controller]=tool">go to Database Analyzer</a>.';
+               'If you want to apply changes selectively, <a href="Install.php?install[action]=importantActions&amp;install[context]=' . $contextService->getContextString() . '&amp;install[controller]=tool">go to Database Analyzer</a>.';
 
                $databaseDifferences = $this->getDatabaseDifferences();
                $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);