From 11e97201320e61cdd380fc6a0080f09aa8238899 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 13 Nov 2014 15:18:32 +0530 Subject: [PATCH] Warn about large item groups in navigation Signed-off-by: Madhura Jayaratne --- libraries/navigation/NavigationTree.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index b5da7aadfd..1b9ae22c61 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -81,6 +81,12 @@ class PMA_NavigationTree */ private $_searchClause2 = ''; + /** + * @var string Whether a warning was raised for large item groups + * which can affect performance. + */ + private $_largeGroupWarning = false; + /** * Initialises the class */ @@ -665,6 +671,16 @@ class PMA_NavigationTree foreach ($prefixes as $key => $value) { if ($value == 1) { unset($prefixes[$key]); + } else if ($value > 500 && ! $this->_largeGroupWarning) { + trigger_error( + __( + 'There are large item groups in navigation panel which ' + . 'may affect the performance. Consider disabling item ' + . 'grouping in the navigation panel.' + ), + E_USER_WARNING + ); + $this->_largeGroupWarning = true; } } if (count($prefixes)) {