[TYPO3-core] RFC #16172: Accessing FE in fresh install fails with RuntimeException "No database selected"

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Jan 10 10:08:12 CET 2011


Steffen Gebert schrieb am 29.12.2010 11:23:
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=16172
>>
>> Problem:
>> In 0015576 a new Exception-Handler was implemented. In the current trunk
>> it will used for the the errors on connecting to the database in the
>> Frontend. In the past there was a error message without the php-methode
>> "exit". The error-message was shown a part of second and then typo3
>> redirected to the install tool in a fresh install. And now there is no
>> redirect after the RuntimeException.
> 
> Sorry Lars for not reviewing your pretty important patch!
> 
> This one fixes the Introduction Package (-> important!), as it's
> currently not possible to enter the 1-2-3(-4) mode, when hitting the FE
> website of the IP (it redirects only, when you try to access the BE).
> 
> Attached is an updated version.
> 
> One comment:
> The removed try/catch was added by #14254 (Fresh install does not
> redirect to Install Tool when mysql is not available). As we before
> check that DB host and database are configured, we don't have to repeat
> this in the catch block now and pass the exception through. Instead, the
> exception now goes it way downwards in the stack.
> The only point, when sql_pconnect() throws an exception is currently,
> when no mysql is available. The behavior after this patch is still the
> same: Redirect to Install Tool (before the connect), if no DB (and host)
> configured or an error message, if connection failed due to lack of MySQL.

+1 by reading and testing Steffen's v2.

Only change I did was the first condition:

 if (!TYPO3_db) {

instead of Steffen's:

 if (!TYPO3_db_host && !TYPO3_db) {

Checking only TYPO3_db was what we had before, and it might be needed
this way for DBAL (may be there is no "TYPO3_db_host" set when
connecting to some non MySQL DB systems).

So committed to trunk in rev. 10017.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list