Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting when the database string is unparsable. #2914

Closed
jlfranklin opened this issue Dec 5, 2017 · 2 comments · Fixed by backdrop/backdrop#2053
Closed

Comments

@jlfranklin
Copy link
Member

jlfranklin commented Dec 5, 2017

Describe your issue or idea

Under certain conditions, the database string is unparsable and the system returns a cryptic error, such as Fatal error: Class 'DatabaseTasks_' not found in.... Instead of a PHP compilation error, it should say something like this:

Database configuration could not be parsed. This is usually because of a typo in the database string or certain special characters in the database's user name or password, such as the at-sign, colon, semicolon, or slash. Please check the database string in settings.php and try again.

Steps to reproduce (if reporting a bug)

Trigger the bug mentioned in #2231.

Actual behavior (if reporting a bug)

Errors that make sense if you're a core developer, and no sense at all if you're a rookie site builder.

Expected behavior (if reporting a bug)

An error message with enough information for the user to take action.

Relevant version/system information (if applicable)

1.x

@quicksketch
Copy link
Member

Thanks @jlfranklin! I tested this out and it helps a lot! I found two additional errors occur when the $database string is not valid, so I filed a rerolled PR at backdrop/backdrop#2053 that combines your code with two more checks, preventing unrelated errors from showing when the database string is not valid.

@quicksketch
Copy link
Member

Merged backdrop/backdrop#2053 into 1.x and 1.8.x. Thanks @jlfranklin for working to improve our bootstrap systems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants