Project

General

Profile

Actions

Bug #75813

closed

DBAL fatals for table2handlerKeys

Added by Anja Leichsenring almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2016-04-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

This dbal config is in AdditionalConfiguration:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg'] = array(
    '_DEFAULT' => array(
        'type' => 'native',
        'config' => array(
            'username' => '',  // Set by default (overridden)
            'password' => '',  // Set by default (overridden)
            'host' => '',  // Set by default (overridden)
            'database' => '' // Set by default (overridden)
        )
    ),
    'DATAPOOL' => array(
        'type' => 'adodb',
        'config' => array(
            'username' => 'xxx',
            'password' => 'xxx',
            'host' => 'xxx',
            'database' => 'xxx',
            'driver' => 'oci8',
            'driverOptions' => array(
                'connectSID' => false,
                'charSet' => 'AL32UTF8'
            ),
        ),
    ),
);

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['table2handlerKeys'] = array(
    'TABLE_1' => 'DATAPOOL',
    'TABLE_2' => 'DATAPOOL',
);

Without the patch, go to the install tool and open the Upgrade Wizards page. It will end up in an error, redirected to the 'deactivate extensions' screen, that reads

Detected Fatal Error
Cannot use object of type ADODB_oci8 as array in [...]/typo3conf/ext/050_core/typo3_src-6.2.21/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php on line 999

This is from a 6.2 installation, but the same code still lives in master.

Actions #1

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47807

Actions #2

Updated by Gerrit Code Review almost 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47807

Actions #3

Updated by Anja Leichsenring almost 8 years ago

the proposed patch causes an exception in master -> Install Tool -> Upgrade Wizards.

Uncaught TYPO3 Exception
Call to undefined function oci_parse() 

Error thrown in file
/var/www/html/typo3/master/typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php in line 1248.

17 ADODB_oci8::_query("select cname,coltype,width, SCALE, PRECISION, NULL…TVAL from col where tname='TABLE_1' order by colno", boolean)

/var/www/html/typo3/master/typo3/sysext/adodb/adodb/adodb.inc.php:
01219:    $this->_queryID = _adodb_debug_execute($this, $sql,$inputarr);
01220:   } else {
01221:    $this->_queryID = @$this->_query($sql,$inputarr);
01222:   }
01223: 

16 ADOConnection::_Execute("select cname,coltype,width, SCALE, PRECISION, NULL…TVAL from col where tname='TABLE_1' order by colno", boolean)

/var/www/html/typo3/master/typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php:
01004: 
01005:   } else {
01006:    $ret = $this->_Execute($sql,false);
01007:   }
01008: 

15 ADODB_oci8::Execute("select cname,coltype,width, SCALE, PRECISION, NULL…TVAL from col where tname='TABLE_1' order by colno")

/var/www/html/typo3/master/typo3/sysext/adodb/adodb/drivers/adodb-oci8.inc.php:
00130:   }
00131:   else {
00132:    $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
00133:   }
00134: 

14 ADODB_oci8::MetaColumns("TABLE_1", boolean)

/var/www/html/typo3/master/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php:
02794:                 break;
02795:             case 'adodb':
02796:                 $fieldRows = $this->handlerInstance[$this->lastHandlerKey]->MetaColumns($tableName, false);
02797:                 if (is_array($fieldRows)) {
02798:                     foreach ($fieldRows as $k => $fieldRow) {

13 TYPO3\CMS\Dbal\Database\DatabaseConnection::admin_get_fields("TABLE_1")

/var/www/html/typo3/master/typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php:
00189:         foreach ($tables as $tableName => $tableStatus) {
00190:             // Fields
00191:             $fieldInformation = $databaseConnection->admin_get_fields($tableName);
00192:             foreach ($fieldInformation as $fN => $fieldRow) {
00193:                 $total[$tableName]['fields'][$fN] = $this->assembleFieldDefinition($fieldRow);

12 TYPO3\CMS\Install\Service\SqlSchemaMigrationService::getFieldDefinitions_database()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Updates/AbstractDatabaseSchemaUpdate.php:
00056:     {
00057:         $expectedSchema = $this->expectedSchemaService->getExpectedDatabaseSchema();
00058:         $currentSchema = $this->schemaMigrationService->getFieldDefinitions_database();
00059: 
00060:         // Difference from expected to current

11 TYPO3\CMS\Install\Updates\AbstractDatabaseSchemaUpdate::getDatabaseDifferences()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Updates/InitialDatabaseSchemaUpdate.php:
00040:         'You have to run this update wizard before you can run any other update wizard to make sure all needed tables and fields are present.';
00041: 
00042:         $databaseDifferences = $this->getDatabaseDifferences();
00043:         $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
00044: 

10 TYPO3\CMS\Install\Updates\InitialDatabaseSchemaUpdate::checkForUpdate("There are tables or fields in the database which n…ake sure all needed tables and fields are present.", 0)

/var/www/html/typo3/master/typo3/sysext/install/Classes/Updates/AbstractUpdate.php:
00120:         $showUpdate = 0;
00121:         $explanation = '';
00122:         $result = $this->checkForUpdate($explanation, $showUpdate);
00123:         return $showUpdate > 0 || $result == true;
00124:     }

9 TYPO3\CMS\Install\Updates\AbstractUpdate::shouldRenderWizard()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php:
00055:         }
00056:         $initialUpdateDatabaseSchemaUpdateObject = $this->getUpdateObjectInstance(\TYPO3\CMS\Install\Updates\InitialDatabaseSchemaUpdate::class, 'initialUpdateDatabaseSchema');
00057:         if ($initialUpdateDatabaseSchemaUpdateObject->shouldRenderWizard()) {
00058:             $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] = array_merge(
00059:                 array('initialUpdateDatabaseSchema' => \TYPO3\CMS\Install\Updates\InitialDatabaseSchemaUpdate::class),

8 TYPO3\CMS\Install\Controller\Action\Tool\UpgradeWizard::executeAction()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php:
00066:     {
00067:         $this->initializeHandle();
00068:         return $this->executeAction();
00069:     }
00070: 

7 TYPO3\CMS\Install\Controller\Action\AbstractAction::handle()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Controller/ToolController.php:
00189:         $toolAction->setPostValues($this->getPostValues());
00190:         $toolAction->setLastError($this->getLastError());
00191:         $this->output($toolAction->handle());
00192:     }
00193: }

6 TYPO3\CMS\Install\Controller\ToolController::dispatchAuthenticationActions()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Controller/ToolController.php:
00061:         $this->outputLoginFormIfNotAuthorized();
00062:         $this->registerExtensionConfigurationErrorHandler();
00063:         $this->dispatchAuthenticationActions();
00064:     }
00065: 

5 TYPO3\CMS\Install\Controller\ToolController::execute()

/var/www/html/typo3/master/typo3/sysext/install/Classes/Http/RequestHandler.php:
00062:                 $controllerClassName = \TYPO3\CMS\Install\Controller\StepController::class;
00063:         }
00064:         GeneralUtility::makeInstance($controllerClassName)->execute();
00065:     }
00066: 

4 TYPO3\CMS\Install\Http\RequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/html/typo3/master/typo3/sysext/core/Classes/Core/Bootstrap.php:
00309: 
00310:         // Execute the command which returns a Response object or NULL
00311:         $this->response = $requestHandler->handleRequest($request);
00312:         return $this;
00313:     }

3 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/html/typo3/master/typo3/sysext/install/Classes/Http/Application.php:
00074:     public function run(callable $execute = null)
00075:     {
00076:         $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
00077: 
00078:         if ($execute !== null) {

2 TYPO3\CMS\Install\Http\Application::run()

/var/www/html/typo3/master/typo3/sysext/install/Start/Install.php:
00101: call_user_func(function () {
00102:     $classLoader = require __DIR__ . '/../../../../vendor/autoload.php';
00103:     (new \TYPO3\CMS\Install\Http\Application($classLoader))->run();
00104: });

1 {closure}()

/var/www/html/typo3/master/typo3/sysext/install/Start/Install.php:
00102:     $classLoader = require __DIR__ . '/../../../../vendor/autoload.php';
00103:     (new \TYPO3\CMS\Install\Http\Application($classLoader))->run();
00104: });

Actions #4

Updated by Morton Jonuschat over 7 years ago

  • Status changed from Under Review to Closed

Resolved on TYPO3 8/master by the migration to Doctrine DBAL

Actions

Also available in: Atom PDF