mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-17 09:52:59 -05:00
Fix 'Trying to access a missing business process node <$name>'
If the imported node is empty or was deleted at a later time, then in NodeTile::render() $link should not be rendered. Also, NodeTile::addDetailsAction() should not add a `href` to this tile.
This commit is contained in:
parent
d8567896f2
commit
51c7fdf6c9
1 changed files with 35 additions and 23 deletions
|
|
@ -85,20 +85,30 @@ class NodeTile extends BaseHtmlElement
|
|||
$this->addActionLinks();
|
||||
}
|
||||
}
|
||||
if (! $node instanceof ImportedNode || ! $node->isMissing()) {
|
||||
$link = $this->getMainNodeLink();
|
||||
if ($renderer->isBreadcrumb()) {
|
||||
$link->prepend((new StateBall(strtolower($node->getStateName())))->addAttributes([
|
||||
'title' => sprintf(
|
||||
'%s %s',
|
||||
$node->getStateName(),
|
||||
DateFormatter::timeSince($node->getLastStateChange())
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
$link = $this->getMainNodeLink();
|
||||
if ($renderer->isBreadcrumb()) {
|
||||
$link->prepend((new StateBall(strtolower($node->getStateName())))->addAttributes([
|
||||
'title' => sprintf(
|
||||
'%s %s',
|
||||
$node->getStateName(),
|
||||
DateFormatter::timeSince($node->getLastStateChange())
|
||||
$this->add($link);
|
||||
} else {
|
||||
$this->add(Html::tag(
|
||||
'a',
|
||||
Html::tag(
|
||||
'span',
|
||||
['style' => 'font-size: 75%'],
|
||||
sprintf('Trying to access a missing business process node "%s"', $node->getNodeName())
|
||||
)
|
||||
]));
|
||||
));
|
||||
}
|
||||
|
||||
$this->add($link);
|
||||
|
||||
if ($node instanceof BpNode && !$renderer->isBreadcrumb()) {
|
||||
$this->add(Html::tag(
|
||||
'p',
|
||||
|
|
@ -191,19 +201,21 @@ class NodeTile extends BaseHtmlElement
|
|||
],
|
||||
Html::tag('i', ['class' => 'icon icon-sitemap'])
|
||||
));
|
||||
if ($node->getBpConfig()->getName() !== $this->renderer->getBusinessProcess()->getName()) {
|
||||
$this->actions()->add(Html::tag(
|
||||
'a',
|
||||
[
|
||||
'data-base-target' => '_next',
|
||||
'href' => $this->renderer->getSourceUrl($node)->getAbsoluteUrl(),
|
||||
'title' => mt(
|
||||
'businessprocess',
|
||||
'Show this process as part of its original configuration'
|
||||
)
|
||||
],
|
||||
Html::tag('i', ['class' => 'icon icon-forward'])
|
||||
));
|
||||
if ($node instanceof ImportedNode) {
|
||||
if (! $node->isMissing()) {
|
||||
$this->actions()->add(Html::tag(
|
||||
'a',
|
||||
[
|
||||
'data-base-target' => '_next',
|
||||
'href' => $this->renderer->getSourceUrl($node)->getAbsoluteUrl(),
|
||||
'title' => mt(
|
||||
'businessprocess',
|
||||
'Show this process as part of its original configuration'
|
||||
)
|
||||
],
|
||||
Html::tag('i', ['class' => 'icon icon-forward'])
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$url = $node->getInfoUrl();
|
||||
|
|
|
|||
Loading…
Reference in a new issue