check if notification exists before removing them

This commit is contained in:
Uwe Steinmann 2013-03-06 12:53:00 +01:00
parent e9e8ed2844
commit c9a18c2538

View File

@ -397,14 +397,18 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
// If any of the notification subscribers no longer have read access, // If any of the notification subscribers no longer have read access,
// remove their subscription. // remove their subscription.
foreach ($this->_notifyList["users"] as $u) { if(isset($this->_notifyList["users"])) {
if ($this->getAccessMode($u) < M_READ) { foreach ($this->_notifyList["users"] as $u) {
$this->removeNotify($u->getID(), true); if ($this->getAccessMode($u) < M_READ) {
$this->removeNotify($u->getID(), true);
}
} }
} }
foreach ($this->_notifyList["groups"] as $g) { if(isset($this->_notifyList["groups"])) {
if ($this->getGroupAccessMode($g) < M_READ) { foreach ($this->_notifyList["groups"] as $g) {
$this->removeNotify($g->getID(), false); if ($this->getGroupAccessMode($g) < M_READ) {
$this->removeNotify($g->getID(), false);
}
} }
} }