Unverified Commit fca1a4a2 authored by Adrien Clairembault's avatar Adrien Clairembault Committed by GitHub

Init active tab on display (#8509)

* Init active tab on display

* Use result from defineTabs instead of hardcoded $main
parent 8acc08f6
......@@ -1193,6 +1193,16 @@ class CommonGLPI {
function display($options = []) {
global $CFG_GLPI;
// Init active tab to main if not defined
if (!isset($_SESSION['glpi_tabs'][self::getType()])) {
// TODO: use array_key_first when php 7.3 is supported
$tabs = array_keys($this->defineTabs());
$first_tab = array_shift($tabs);
if ($first_tab) {
Session::setActiveTab(self::getType(), $first_tab);
}
}
if (isset($options['id'])
&& !$this->isNewID($options['id'])) {
if (!$this->getFromDB($options['id'])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment