new adodb_error() missing db_error.html customization

For problem reports, and discussions about the CMSMS 2.2 beta.

This board will be locked once CMSMS 2.2 is officially released.
Locked
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

new adodb_error() missing db_error.html customization

Post by fredp »

In CMSMS 1.21.1, and earlier releases, the adodb_error() function would invoke an optionally user defined db_error.html page so that developers could customize/style how DB errors would be reported to visitors of that site. I have sites that use this.

It appears, however, that this functionality is not supported in 2.2beta! :(

I discovered this "regression" after successfully running the installer to upgrade a copy of a 1.12.1 install on a test machine. As luck would have it, while attempting to view the converted site, an unrelated MySQL corruption trashed some db user passwords, resulting in login failures. I noticed the MySQL problem because visiting the site yielded an all white screen with this generic message:
Sorry, something has gone wrong. Please contact a site administrtor. (CMSMS\Database\DatabaseConnectionException)
Not, however, the customized db_error.html page that I would have expected/desired.

You can reproduce the same error by temporarily changing a db_username or db_password value in config.php and then attempt to view any page on your site.

I don't know if the loss of customization was inadvertent or by design, but it would be great if db_error.html or some other form of DB error reporting customization were available in 2.2.

Thanks to the team for all the effort!
Now, back to the upgrade testing...
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: new adodb_error() missing db_error.html customization

Post by calguy1000 »

The db_error.html thing was an undocumented feature.

it was implemented in 2008 because otherwise fatal errors could reveal the database name, and username (though not the password).

And PHP didn't have exceptions at the time.

It was deemed a minor feature that only a small percentage of the user community knew about the ability to nicely style an HTML page for a fatal database error message. Note, that only applied to database errors, but not other types of fatal errors.

It was also a potential security issue.

So we've made sure that the private information is hidden when a critical, fatal database error occurs, provided a hint as to what the error may be... but the output page cannot be styled.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: new adodb_error() missing db_error.html customization

Post by fredp »

Understood. But, just to be clear, can developer code catch and handle an CMSMS\Database\DatabaseConnectionException? If not, then while the loss of customization is unfortunate, it's not a huge deal.

I'm old enough to remember when one could buy Generic "BEER" in the store--nothing but an all white label with the word "BEER" on it. Not stylish, but cheap and it did what beer does. ;-) ;-) ;-)

You might still consider giving developers at least some way to insert text or an email link into the current generic message. It says to "Please contact a site administrtor.", but with the site offline I'm not sure most visitors will know how to do that. Also, I just noticed the misspelling of 'administrator'.

If you'd like, I can prepend '[will not fix]', or whatever, onto the article title.

Thanks again for all the hard work!!
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 169
Joined: Fri Feb 06, 2009 2:08 pm

Re: new adodb_error() missing db_error.html customization

Post by PinkElephant »

Just a +1 for fredp's take. Some of my finest work is in db_error.html ;) and it's the sort of detail that helps deliver a stand-out site.

I appreciate that with the huge improvements in 2.2 this feature isn't likely to see the light of day again... but 'just saying'.

(The minor "administrtor" typo is still present, line 172 \lib\include.php)

Thanks, all.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: new adodb_error() missing db_error.html customization

Post by fredp »

PinkElephant, thanks for the comment! It reminded me to report the following:

Dev Team, please note that there is a copy of doc/db_error.html in the data/data.tar.gz archive in the standalone Beta3 installer (cmsms-2.2-beta3-install.expanded.zip). Not sure if is also included in the PHAR installer. This file might cause some confusion if it makes it into the final release and then it doesn't work when a user copies it to doc root, as it instructs:
doc/db_error.html wrote:/**
* Move this file to the website root and it will be displayed in case of a database connection failure.
*/
...
Thanks again for all the work!
fredp
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: new adodb_error() missing db_error.html customization

Post by calguy1000 »

Thanks. I will remove that file soon.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “[locked] CMSMS 2.2 Beta”