[BUGFIX] Issues in TYPO3 CMS 7 after migration to Doctrine 55/51355/2
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 19 Jan 2017 03:38:59 +0000 (22:38 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 19 Jan 2017 03:51:19 +0000 (04:51 +0100)
Change-Id: I61533df71f25a4cfc3c5369461580bce2611f174
Resolves: #79384
Reviewed-on: https://review.typo3.org/51355
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/Hook/Backend/Form/Wizard/SuggestReceiver.php
Classes/Hook/Core/DataHandling/ProcessDataMap.php
Classes/PiBaseApi.php
Classes/Slot/Extensionmanager/AfterExtensionInstall.php
Classes/Utility/DatabaseUpdateUtility.php
Classes/Utility/LocalizationUtility.php

index 256d668..4eedda0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-18  Stanislas Rolland  <typo3(arobas)sjbr.ca>
+
+       * Resolves #79384: Issues in TYPO3 CMS 7 after migration to Doctrine
+
 2017-01-17  Stanislas Rolland  <typo3(arobas)sjbr.ca>
 
        * Resolves #79359: Migrate PiBaseApi to Doctrine
index 36e4ca1..d04c583 100644 (file)
@@ -50,7 +50,7 @@ class SuggestReceiver extends \TYPO3\CMS\Backend\Form\Wizard\SuggestWizardDefaul
      */
     protected function prepareSelectStatement()
     {
-       if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+       if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                $expressionBuilder = $this->queryBuilder->expr();
                        $searchWholePhrase = !isset($this->config['searchWholePhrase']) || $this->config['searchWholePhrase'];
                        $searchString = $this->params['value'];
@@ -152,7 +152,7 @@ class SuggestReceiver extends \TYPO3\CMS\Backend\Form\Wizard\SuggestWizardDefaul
         */
        protected function prepareOrderByStatement()
        {
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        // Get the label field for the current language, if any is available
                        $lang = LocalizationUtility::getCurrentLanguage();
                        $lang = LocalizationUtility::getIsoLanguageKey($lang);
index 35f14d3..7696193 100644 (file)
@@ -106,7 +106,7 @@ class ProcessDataMap
                                $country = $countryRepository->findOneByUid((int)$id);
                                // Get the country zones
                                $countryZones = $country->getCountryZones()->toArray();
-                               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+                               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                                        if (count($countryZones)) {
                                                $connection = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getConnectionForTable('static_country_zones');
                                                foreach ($countryZones as $countryZone) {
index 095487e..6666c7f 100644 (file)
@@ -308,7 +308,7 @@ class PiBaseApi extends AbstractPlugin
                }
                array_unique($prefixedTitleFields);
 
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        $queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
                                ->getQueryBuilderForTable($table );
                        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::class));
@@ -405,7 +405,7 @@ class PiBaseApi extends AbstractPlugin
                foreach ($titleFields as $titleField) {
                        $prefixedTitleFields[] = $table . '.' . $titleField;
                }
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        $queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
                                ->getQueryBuilderForTable($table );
                        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::class));
@@ -483,7 +483,7 @@ class PiBaseApi extends AbstractPlugin
                foreach ($titleFields as $titleField) {
                        $prefixedTitleFields[] = $table . '.' . $titleField;
                }
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        $queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
                                ->getQueryBuilderForTable($table );
                        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::class));
@@ -549,7 +549,7 @@ class PiBaseApi extends AbstractPlugin
                foreach ($titleFields as $titleField) {
                        $prefixedTitleFields[] = $table . '.' . $titleField;
                }
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        $queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
                                ->getQueryBuilderForTable($table );
                        $queryBuilder->setRestrictions(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::class));
index ec5119b..2f42666 100644 (file)
@@ -67,7 +67,7 @@ class AfterExtensionInstall {
                if (strpos($extensionKey, 'static_info_tables') === 0) {
                        $extensionKeyParts = explode('_', $extensionKey);
                        if (count($extensionKeyParts) === 3) {
-                               $extTablesStaticSqlRelFile = substr(ExtensionManagementUtility::extRelPath($extensionKey), 3) . 'ext_tables_static+adt.sql';
+                               $extTablesStaticSqlRelFile = ExtensionManagementUtility::siteRelPath($extensionKey) . 'ext_tables_static+adt.sql';
                        }
                        if (
                                // Base extension with data already imported once
index f262e4e..e45b96c 100644 (file)
@@ -61,7 +61,7 @@ class DatabaseUpdateUtility
                                        $fields[$fN] = $fV[0];
                                }
                                if (count($fields)) {
-                                       if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+                                       if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                                                $queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getQueryBuilderForTable($parsedResult['TABLE']);
                                                $queryBuilder->getRestrictions()->removeAll();
                                                $queryBuilder->update($parsedResult['TABLE']);
index 062194d..7d16e77 100644 (file)
@@ -87,7 +87,7 @@ class LocalizationUtility
         */
        public static function getLabelFieldValue($identifiers, $tableName, $language, $local = false)
        {
-               if (class_exists(\TYPO3\CMS\Core\Database\ConnectionPool::class)) {
+               if (class_exists('TYPO3\\CMS\\Core\\Database\\ConnectionPool')) {
                        $value = '';
                        $labelFields = self::getLabelFields($tableName, $language, $local);
                        if (count($labelFields)) {
@@ -135,10 +135,10 @@ class LocalizationUtility
                                                }
                                        }
                                }
-                       } else {
-                               // TYPO3 CMS 7 LTS
-                               $value = $this->getCompatibleLabelFieldValue($identifiers, $tableName, $language, $local);
                        }
+               } else {
+                       // TYPO3 CMS 7 LTS
+                       $value = self::getCompatibleLabelFieldValue($identifiers, $tableName, $language, $local);
                }
                return $value;
        }