|
44 | 44 | use ipl\Sql\Filter\Exists;
|
45 | 45 | use ipl\Web\Widget\CopyToClipboard;
|
46 | 46 | use ipl\Web\Widget\EmptyState;
|
| 47 | +use ipl\Web\Widget\EmptyStateBar; |
47 | 48 | use ipl\Web\Widget\HorizontalKeyValue;
|
48 | 49 | use Icinga\Module\Icingadb\Widget\ItemList\CommentList;
|
49 | 50 | use Icinga\Module\Icingadb\Widget\PluginOutputContainer;
|
@@ -618,12 +619,18 @@ protected function fetchCustomVars()
|
618 | 619 | */
|
619 | 620 | protected function createRootProblems(): ?array
|
620 | 621 | {
|
| 622 | + if (Backend::getDbSchemaVersion() < 6 && ! $this->object->state->is_reachable) { |
| 623 | + return [ |
| 624 | + HtmlElement::create('h2', null, Text::create(t('Root Problems'))), |
| 625 | + new EmptyStateBar(t('Please update Icinga DB to view root problems.')) |
| 626 | + ]; |
| 627 | + } |
| 628 | + |
621 | 629 | // If a dependency has failed, then the children are not reachable. Hence, the root problems should not be shown
|
622 | 630 | // if the object is reachable. And in case of a service, since, it may be also be unreachable because of its
|
623 | 631 | // host being down, only show its root problems if it's really caused by a dependency failure.
|
624 | 632 | if (
|
625 | 633 | $this->object->state->is_reachable
|
626 |
| - || Backend::getDbSchemaVersion() < 6 |
627 | 634 | || ($this->object instanceof Service && ! $this->object->has_problematic_parent)
|
628 | 635 | ) {
|
629 | 636 | return null;
|
@@ -671,7 +678,7 @@ protected function createRootProblems(): ?array
|
671 | 678 | */
|
672 | 679 | protected function createAffectedObjects(): ?array
|
673 | 680 | {
|
674 |
| - if (! $this->object->state->affects_children || Backend::getDbSchemaVersion() < 6) { |
| 681 | + if (! isset($this->object->state->affects_children) || ! $this->object->state->affects_children) { |
675 | 682 | return null;
|
676 | 683 | }
|
677 | 684 |
|
|
0 commit comments