Bug #82795
closedPage unavailable handling broken in connectToDB of TypoScriptFrontendController
100%
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.
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
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
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
Updated by Alexander Stehlik over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8c40079dd3f2140b77a381ec20fcc595d7a76419.
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
Updated by Alexander Stehlik over 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset 84f2552553deb5c6c2ec4cd3c60cb19e43427d5a.
Updated by Jasmina Ließmann over 6 years ago
- Related to Bug #83577: Database analyzer: Error message by usage of enums added
Updated by Helmut Hummel over 5 years ago
- Related to Bug #86154: DatabaseConnection does not reset internal state on close() added