[BUGFIX] Fix context parameter in Database Analyzer URL 51/36251/2
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:18:30 +0000 (20:18 +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/36251
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 f40f6ad..281ec7c 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');
-               $this->schemaMigrationService = $objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
-               $this->expectedSchemaService = $objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
+               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               $this->schemaMigrationService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
+               $this->expectedSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
        }
 
        /**
index ec27bf6..8163281 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');
                $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);