Unverified Commit 3ee4b668 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(errors) Fix error breadcrumbs when source is a tab

Remove trailing ">"

issue #6051
Showing with 10 additions and 4 deletions
+10 -4
...@@ -104,24 +104,30 @@ class SimplePluginError extends FusionDirectoryError ...@@ -104,24 +104,30 @@ class SimplePluginError extends FusionDirectoryError
{ {
$html = ''; $html = '';
$breadcrumbs = [];
if (isset($this->object)) { if (isset($this->object)) {
$html .= htmlescape($this->object->getBaseObject()->dn.' > '); $breadcrumbs[] = htmlescape($this->object->getBaseObject()->dn);
} }
if (isset($this->tab) && isset($this->tab->parent->by_name[get_class($this->tab)])) { if (isset($this->tab) && isset($this->tab->parent->by_name[get_class($this->tab)])) {
$html .= htmlescape($this->tab->parent->by_name[get_class($this->tab)].' > '); $breadcrumbs[] = htmlescape($this->tab->parent->by_name[get_class($this->tab)]);
} }
if (isset($this->attribute)) { if (isset($this->attribute)) {
$label = $this->attribute->getLabel(); $label = $this->attribute->getLabel();
if (empty($label)) { if (empty($label)) {
$html .= '<i>'.htmlescape($this->attribute->getLdapName()).'</i>'; $breadcrumbs[] = '<i>'.htmlescape($this->attribute->getLdapName()).'</i>';
} else { } else {
$html .= htmlescape($label); $breadcrumbs[] = htmlescape($label);
} }
$example = $this->attribute->getExample(); $example = $this->attribute->getExample();
} }
if (!empty($breadcrumbs)) {
$html .= implode(htmlescape(' > '), $breadcrumbs);
}
$html .= '<br/><br/>'; $html .= '<br/><br/>';
$html .= $this->htmlMessage; $html .= $this->htmlMessage;
......
Supports Markdown
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