Project

General

Profile

Actions

Bug #47744

closed

Fatal 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.

Status:
Closed
Priority:
Should have
Category:
Install Tool
Target version:
-
Start date:
2013-04-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #48138: Cannot connect to the current databaseClosedOliver Hader2013-05-13

Actions
Related to TYPO3 Core - Bug #47746: Converting 4.7 sites to 6.1 sites much to complicated and breaking - white pages in Install toolClosedOliver Hader2013-04-30

Actions
Related to TYPO3 Core - Bug #55095: Replace SHOW DATABASE by query to schemaClosedMorton Jonuschat2014-01-17

Actions
Actions #1

Updated by Alexander Opitz over 11 years ago

Can your database user, which you are using for TYPO3, execute following query: "SHOW DATABASES"?

Actions #2

Updated by Chris topher over 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (6.1.1)
Actions #3

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.

  1. Remove skip-show-database if you use phpMyAdmin, TYPO3 or a similar tool to
  2. 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

Actions #4

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.

Actions #5

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

Actions #6

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.

Actions #7

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.

Actions #8

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to New

Add test for privileges "Show databases" to install tool.

Actions #9

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).

Actions #10

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.

Actions #11

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.

Actions #12

Updated by Alexander Opitz about 11 years ago

  • Assignee set to Alexander Opitz
Actions #13

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

Actions #14

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.

Actions #15

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

Actions #16

Updated by Ernesto Baschny about 11 years ago

Oh dear, that makes this setting pretty useless as a "security mechanism" then. Thanks for researching.

Actions #17

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. ;)

Actions #18

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

Actions #19

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

Actions #20

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

Actions #21

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

Actions #22

Updated by Alexander Opitz about 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF