Commit 68ded49c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5021 check hook should be able to access errors number

Showing with 15 additions and 1 deletion
+15 -1
...@@ -724,7 +724,7 @@ class simplePlugin extends plugin ...@@ -724,7 +724,7 @@ class simplePlugin extends plugin
function check () function check ()
{ {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'check'); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'check');
$message = parent::check(); $message = array();
foreach ($this->attributesInfo as $sectionInfo) { foreach ($this->attributesInfo as $sectionInfo) {
foreach ($sectionInfo['attrs'] as $attr) { foreach ($sectionInfo['attrs'] as $attr) {
...@@ -739,6 +739,20 @@ class simplePlugin extends plugin ...@@ -739,6 +739,20 @@ class simplePlugin extends plugin
} }
} }
$this->callHook('CHECK', array('nbCheckErrors' => count($message)), $returnOutput);
if (!empty($returnOutput)) {
$message[] = join("\n", $returnOutput);
}
/* Check entryCSN */
if (!empty($this->entryCSN)) {
$current_csn = getEntryCSN($this->dn);
if (($current_csn != $this->entryCSN) && !empty($current_csn)) {
$this->entryCSN = $current_csn;
$message[] = _('The object has changed since opened in FusionDirectory. All changes that may be done by others will get lost if you save this entry!');
}
}
return $message; return $message;
} }
......
  • bmortier @bmortier

    mentioned in issue #1598

    By Jonathan Swaelens on 2017-09-02T15:32:19 (imported from GitLab)

    ·

    mentioned in issue #1598

    By Jonathan Swaelens on 2017-09-02T15:32:19 (imported from GitLab)

    Toggle commit list
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