protected function sortModules()
    {
        parent::sortModules();

        if ($this->root !== null && $this->root_search_path !== $this->search_path)
        {
            $this->root = null;
            $this->root_search_path = null;
        }
    }