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

Get the following error when browsing the UI #86

Closed
barrychapman opened this issue Feb 1, 2017 · 2 comments
Closed

Get the following error when browsing the UI #86

barrychapman opened this issue Feb 1, 2017 · 2 comments

Comments

@barrychapman
Copy link

barrychapman commented Feb 1, 2017

	( ! ) Notice: Undefined index: dbs in /var/www/vhosts/redis_gui/views/layout.php on line 129
	Call Stack
	#	Time	Memory	Function	Location
	1	0.0000	360888	{main}( )	.../index.php:0
	2	0.1430	370560	router->route( )	.../index.php:51
	3	0.1439	403152	Welcome_Controller->indexAction( )	.../router.php:117
	4	0.1440	405064	PhpTemplate->render( )	.../welcome.php:7
	5	0.1442	419824	PhpTemplate->renderPartial( )	.../php.php:23
	6	0.1446	438960	include( '/var/www/vhosts/redis_gui/views/layout.php' )	.../php.php:32**
	**

Config:

	'database'  => array(
			'driver' => 'redis',
			'mysql'  => array(
				'host'     => 'xxxxxxxxx:2999',
				'username' => 'user',
				'password' => 'Password!'
			),
			'redis' => array(
				array(
					'host'     => '172.123.4.233',
					'port'     => '6379',
					'password' => null,
					'database' => 0,
					'max_databases' => 16, /* Manual configuration of max databases for Redis < 2.6 */
					'stats'    => array(
						'enable'   => 1,
						'database' => 0,
					),
					'dbNames' => array(
						'redis' => 'Redis DB'
					/* Name databases. key should be database id and value is the name */
					),
				),
			),
		),
@sasanrose
Copy link
Owner

@barrychapman I can't reproduce this, can you provide more information? like the exact steps to reproduce this bug, and how did you install php redmin? Are you using Docker?

@mnvx
Copy link
Contributor

mnvx commented Mar 29, 2017

Problem is here: https://github.com/sasanrose/phpredmin/blob/master/views/layout.php#L128

And Here: https://github.com/sasanrose/phpredmin/blob/master/libraries/controller.php#L47

If $this->infoModel->getDbs($info); return empty array ([]) then index 'dbs' will not be found in layout. It can be fixed by changing line expression in layout:

<?= ($this->app->current['dbs'][$this->app->current['database']]['name'] ? $this->app->current['dbs'][$this->app->current['database']]['name'] . " (DB {$this->app->current['database']})" : "DB {$this->app->current['database']}") ?>

to

<?= (isset($this->app->current['dbs'][$this->app->current['database']]['name']) ? $this->app->current['dbs'][$this->app->current['database']]['name'] . " (DB {$this->app->current['database']})" : "DB {$this->app->current['database']}") ?>

@mnvx mnvx mentioned this issue Apr 7, 2017
sasanrose added a commit that referenced this issue Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants