Bug #47744
closedFatal error: Call to a member function fetch_object() on a non-object in
Added by Andreas Becker (Andi) over 11 years ago. Updated about 6 years ago.
100%
Description
Fatal error: Call to a member function fetch_object() on a non-object in /typo3_src-6.1.0/typo3/sysext/core/Classes/Database/DatabaseConnection.php on line 1289
When trying to open up Basic Configuration in Install Tool
But site is working
Backend is working
DB is working
Updated by Alexander Opitz over 11 years ago
Can your database user, which you are using for TYPO3, execute following query: "SHOW DATABASES"?
Updated by Chris topher over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
6.1.1)
Updated by Andreas Becker (Andi) over 11 years ago
Hi Alexander
Thanks for this hint - previous Installations of TYPO3 until 4.7 did not had this problem
Ad this hint to the install tool so people will know about it that TYPO3 since 6.1 is getting a "special case" like phpMyAdmin.
- Remove skip-show-database if you use phpMyAdmin, TYPO3 or a similar tool to
- manage your databases, it will just frustrate you or your users.
#skip-show-database
as i.e. virtualmin, adminer, chive shows you tables correctly even you are logged in as a user and "skip-show-database" enabled
i.e. if your logged in a typo3 installation and have adminer installed your database will show up correctly
or even better perform a check before installing TYPO3 6.1 of all Server requirements to run TYPO3 6.1+ and than continue with the installation. In this case the hint should simply pop up when "skip-show-database" is not disabled
Andi
Updated by Alexander Opitz over 11 years ago
Also previous installations of TYPO3 have this problem.
Anyway, how does virtualmin, adminer, chive, ... can show the databases if "SHOW DATABASES" isn't allowed for the user?
BTW. a check for this (and other DB privileges are planed.
Updated by Andreas Becker (Andi) over 11 years ago
Hi Alexander you wrote:
"Anyway, how does virtualmin, adminer, chive, ... can show the databases if "SHOW DATABASES" isn't allowed for the user?"
I only wrote about what is what it is. only phpMyAdmin and TYPO3 seems to have problems with this settings.
Andi
Updated by Alexander Opitz over 11 years ago
As I've no crystal ball, I can't predict why it should work with "virtualmin, adminer, chive" on your system and not with TYPO3 and phpMyAdmin.
Also, if this configuration would be the same as with TYPO3 4.7, you should had this problem already with 4.7, as the code didn't changed on this point. So this all (and most of the other bugs from you) seem to be a problem of your system.
Updated by Andreas Becker (Andi) over 11 years ago
Well it is not one but 3 systems which are different from each other (and only one is ours) and same symptoms. Until 4.7 we had never those problems! right! but also adminer integrated in the TYPO3 backend was just working fine and much better than phpmyadmin. On the servers itself has nothing changed afaik.
Nevertheless I would put a hint into the install tool so people know that TYPO3 is like phpmyadmin a special case which will not make them happy if they have it enabled.
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to New
Add test for privileges "Show databases" to install tool.
Updated by Ernesto Baschny about 11 years ago
- Status changed from New to Accepted
- Complexity set to easy
I agree that we need a better handling for that. But I would not require SHOW DATABASES priviledge.
1) admin_get_dbs() should thow an Exception instead of Fatal error in this situation (when $db_list === FALSE)
2) Install tool should catch this exception and then instead of presenting a list of databases just an empty INPUT field where the user has to enter the database name himself
I was about to create this patch for 6.2 but then I had to fiddle with the FLUID templates and got stuck.. but it should be easy for the FLUID wizards out there.
For 6.0+6.1 I would simply catch the error in "Basic Configuration" and ignore it (as it is not relevant when you are there) and do something similar as (2) for the first install (or skip this part, as it's probably not worth adding it to 6.0+1 anymore).
Updated by Alexander Opitz about 11 years ago
Since TYPO3 CMS 4.7 the minimum MySQL version is 5.0, since this version we could also use:
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA
to get the databases to which we have access. Maybe changing the "SHOW DATABASE" to this could be enough.
Updated by Alexander Opitz about 11 years ago
Tested localy:
> SHOW DATABASES #1227 - Access denied; you need (at least one of) the SHOW DATABASES privilege(s) for this operation > SELECT SCHEMA_NAME FROM information_schema.SCHEMATA SCHEMA_NAME ----------- information_schema
So best way to go is to change the SQL statement.
The DBAL native driver uses the deprecated php funtion "mysql_list_dbs" which will do a "SHOW DATABASES" this should be changed in another issue report.
Updated by Gerrit Code Review about 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23637
Updated by Alexander Opitz about 11 years ago
To test the patch you need to change the my.cfg of your mysql server. You need to add "skip-show-database" to the [mysqld] section and restart your mysql server.
Updated by Gerrit Code Review about 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23637
Updated by Ernesto Baschny about 11 years ago
Oh dear, that makes this setting pretty useless as a "security mechanism" then. Thanks for researching.
Updated by Alexander Opitz about 11 years ago
Not really, "SHOW DATABASES" can show more databases then where you have no privileges, the shema only shows databases where you have some. ;)
Updated by Gerrit Code Review about 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23637
Updated by Gerrit Code Review about 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23637
Updated by Gerrit Code Review about 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23637
Updated by Gerrit Code Review about 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/23795
Updated by Alexander Opitz about 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 71690327d2c7e07efae3637d6d1c26c071b385e8.