Bug #80358

Wrong dbal instance used for admin_get_tables()

Added by Nicole Cordes over 1 year ago. Updated about 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2017-03-20
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Given:
  • default database configuration in LocalConfiguration
  • separate table mapping in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg'] and $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['table2handlerKeys'] to an external database for several tables with native type
  • trying to access Install Tool > Upgrade Wizard throws error "Call to a member function free() on a non-object in typo3\sysext\dbal\Classes\Database\DatabaseConnection.php on line 2748"
Reason:
  • dbal tries to fetch available database tables from the default connection (typo3/sysext/dbal/Classes/Database/DatabaseConnection.php:2742)
  • using $this->query() uses $this->lastHandlerKey to resolve the handler instance
  • $this->lastHandlerKey might not equal the default but any other configured handler configuration, thus the wrong instance is used to resolve the database query
Solution:
  • initialize $this->lastHandlerKey to the right "_DEFAULT" value

Associated revisions

Revision 54e2b699 (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] DBAL: Ensure correct mysqli resource for admin_get_tables query

The admin_get_tables method tries to fetch all available database tables
from the default connection. But using the native mode, the query is
executed with the $this->lastHandlerKey link which might not be the
default connection. This patch ensures the correct mysqli resource is
used to resolve the database queries.

Resolves: #80358
Releases: 7.6
Change-Id: I3b8224e5377aad64e556052bbea37dae39ca1bb7
Reviewed-on: https://review.typo3.org/52106
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Elmar Hinz <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#2 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

#3 Updated by Nicole Cordes over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF