When trying to requery a bookmark from console, I get the following error:
PHP Fatal error: Call to a member function getTables() on a non-object in /…/phpMyAdmin-4.3.10-english/libraries/relation.lib.php on line 1889
phpMyAdmin shows a "Error in Processing Request" then (500).
Steps to reproduce the issue:
Hey
I am not able to reproduce it. Is it happening for all the bookmarks queries you have ? or is it specific to some particular query ?
Thanks.
It happens for all (5) bookmarks - 1 shared, 4 private.
Navigating to the database, using the "SQL" tab and then issuing the bookmarks there by the way works.
Well,
I am also not able to reproduce it in any way. What error message is generating?
I just updated to phpMyAdmin 4.3.11 and I still have the problem.
The reproduction steps still are the same as mentioned initially. The error I see in phpMyAdmin is:
Error in Processing Request
Error code: 500
Error text: Internal Server Error
The error I see on the webserver is:
PHP Fatal error: Call to a member function getTables() on a non-object in /…/phpMyAdmin-4.3.11-english/libraries/relation.lib.php on line 1889
Refreshing bookmarks does not work either:
Console → Bookmarks → Refresh
I get in phpMyAdmin:
Error in Processing Request
Error code: 500
Error text: Internal Server Error
And on the server I see:
PHP Fatal error: Call to a member function isSuperuser() on a non-object in /…/phpMyAdmin-4.3.11-english/libraries/check_user_privileges.lib.php on line 15
Maybe this issue is related to [#4700] and my configuration using "$cfg['ServerDefault'] = 0;"?
Related
Bugs:
#4700I am not able to recreate the bug. Can you please post the error?
Can you please elaborate? What additional error message do you expect? Where can I get that possibly expected error message from?
I posted the error message I get in phpMyAdmin and the one I see on the server. Which one am I missing?
Alexander,
you correctly reported the error message.
I tried on the demo server, but I am not able to reproduce the issue there. I noticed that one uses PHP 5.4, while I still use 5.3.
I did a quick check on my server using the code below:
$s = var_export(array_key_exists('dbi', $GLOBALS), TRUE) . "\n" . var_export($GLOBALS['dbi'], TRUE);
file_put_contents('/tmp/pmadbg', $s);
unset($s);
The result is "false" and "NULL" - more or less expected. I haven't dug any further, but with some help of where the "interesting" parts are, I can do some debugging on my own.
Okay, I dug a bit deeper. Line numbers might be off slightly due to some printf debugging.
libraries/common.inc.php:822:
empty($cfg['Server']) is TRUE, so $GLOBALS['dbi'] doesn't get set.
libraries/common.inc.php:1148:
$GLOBALS['is_superuser']
= isset($GLOBALS['dbi']) && $GLOBALS['dbi']->isSuperuser();
Some code seems to exist to handle this situation. But no idea what this one is good for. I just do not know the architecture at all.
By the way, I followed the execution path of "Bookmarks → Refresh".
At libraries/common.inc.php:674, $cfg['Servers'] still contains the configured array. And still at line 800.
Okay, there is a difference between $cfg['Servers'] and $cfg['Server'].
Around line 780:
The request has no "server" set:
https://…/import.php?console_bookmark_refresh=refresh&token=…&ajax_request=true&_nocache=…
if (!empty($cfg['Servers'][$cfg['ServerDefault']])) {
"ServerDefault" is 0, so this item does not exist. This ends up with an empty $cfg['Server'].
So maybe the request from JavaScript should include a "server"?
Though, I have no idea why it works without "server" on the demo server but not for me. There is a difference somewhere …
Last edit: Alexander Schuch 2015-03-08
Alexander,
You have identified the cause of the problem correctly. However, the issue has beeb fixed on QA_4_4 and master branches. So the if you tried out demo.phpmyadmin.net/QA_4_4 or demo.phpmyadmin.net/master it's no wonder you were not able to reproduce it. Moreover, you need to be on a server which is not the default server, unless default server is 0, like in your case.
There were couple of more instances that did not use the server parameter and they are fixed here https://github.com/phpmyadmin/phpmyadmin/commit/943bf8b9077656cf1812d2cb745a1dfa1a5dbf53