Project

General

Profile

Actions

Bug #82795

closed

Page unavailable handling broken in connectToDB of TypoScriptFrontendController

Added by Alexander Stehlik over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2017-10-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.1
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Expected behavior

When the database is not available and a pageUnavailable_handling is configured, the configured handler should be used to display the error.

Current behavior

You get the "Oops, an error occurred" Exception message.

The problem

The getConnectionForTable() call in connectToDB() which is outside the try / catch block already tries to establish a database connection. When this fails the Exception is not catched.

Possible solutions

Move getConnectionForTable()

Move the getConnectionForTable() method call inside the try catch block.

Downside: you can not print the database connection name in the Exception message

Move Connection initialization

The code that is currently executed in ConnectionPool::getDatabaseConnection() should be moved to the Connection in an overwritten connect() method.

The problematic calls here are $conn->getDatabasePlatform() which always cause the connection to be established.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #83577: Database analyzer: Error message by usage of enumsClosed2018-01-16

Actions
Related to TYPO3 Core - Bug #86154: DatabaseConnection does not reset internal state on close()Closed2018-09-05

Actions
Actions #1

Updated by Gerrit Code Review over 6 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/54432

Actions #2

Updated by Gerrit Code Review over 6 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/54432

Actions #3

Updated by Gerrit Code Review over 6 years ago

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

Actions #4

Updated by Alexander Stehlik over 6 years ago

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

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Resolved to Under Review

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

Actions #6

Updated by Alexander Stehlik over 6 years ago

  • Status changed from Under Review to Resolved
Actions #7

Updated by Jasmina Ließmann over 6 years ago

  • Related to Bug #83577: Database analyzer: Error message by usage of enums added
Actions #8

Updated by Helmut Hummel over 5 years ago

  • Related to Bug #86154: DatabaseConnection does not reset internal state on close() added
Actions #9

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF