• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: new adodb_error() missing db_error.html customization
PostPosted: Tue Mar 21, 2017 1:38 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sun Jul 27, 2008 1:36 am
Posts: 218
Location: USA
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:
Quote:
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:
File comment: Sysinfo
sysinfo.2017-03-20.txt [2.18 KiB]
Downloaded 56 times

_________________
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: new adodb_error() missing db_error.html customization
PostPosted: Tue Mar 21, 2017 9:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7925
Location: Fernie British Columbia, Canada
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: new adodb_error() missing db_error.html customization
PostPosted: Wed Mar 22, 2017 5:31 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sun Jul 27, 2008 1:36 am
Posts: 218
Location: USA
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: new adodb_error() missing db_error.html customization
PostPosted: Tue May 23, 2017 12:12 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Feb 06, 2009 2:08 pm
Posts: 132
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: new adodb_error() missing db_error.html customization
PostPosted: Wed May 24, 2017 2:15 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sun Jul 27, 2008 1:36 am
Posts: 218
Location: USA
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: new adodb_error() missing db_error.html customization
PostPosted: Wed May 24, 2017 2:59 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7925
Location: Fernie British Columbia, Canada
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting