Repository navigation
Fix rendering of database connection error page - #1113
Conversation
|
do users of appswebroots understand that it can be false? |
I'm not quite sure what you're saying. I don't know what the purpose of appswebroots is. |
|
appswebroots is used in the filePath function to generate urls for app assets (images/js/css) |
|
+1 - I confirm that this adds a visible failure feedback when using PostgreSQL as a database backend. However I am not sure if the error message does not show too much details: "Failed to connect to pgsql database. (SQLSTATE[08006] [7] could not connect I often see such error messages in small web pages on the internet. I think I mean that is fine for the local administrator, but it is internal stuff. |
|
I would suggest to return 503, yes. |
|
Well maybe we should be returning 503 in other situations as well. checkServer() and checkConfig() for instance. I agree with @arkascha, I'll make the message more discreet. |
|
I was thinking in the direction. |
|
You mean 503, not 500 right? |
|
500 or 503 or 50x ;-) |
|
@DeepDiver1975 I'm not certain how to do it as a parameter to the function. Passing 'HTTP/1.1 503 Service Temporarily Unavailable' or other status message to the function doesn't seem like it makes anything easier. There's also quite a few addHeader functions around in lib/template.php and lib/util.php Nothing seems to be using them though. |
|
I would design the additional parameter to be an int (e.g. 503) and within the template we expand the int to the header(s). And yes - addheader/header calls deserve some house cleaning ;-) But this is no scope of this PR. Let's merge! 🚀 |
Fix rendering of database connection error page
|
@karlitschek as usual: shall we backport this one? THX |
Backport of #1113, Fix rendering of database connection error page
|
There is also a setStatus function in OC_Response which could be used for the int to string conversion |
This is a fix for #1085. When there is no database connection the error page was not being properly rendered because of a loop of additional queries by the template layout.
This moves the calls for apps web roots to only the user template layout and the setting of the js and css minimizer to the setup.
It wasn't ideal, but I also had to unset the logged in user because the localization was trying to get the user's language preference using the database. Are there any other ideas?
@bartv2