Commit 88b2c34534e0c4d9d99ce4ea7a1cbdd4dc785d35
1 parent
a7674694
added error check
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@917 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
6 deletions
lib/subscriptions/SubscriptionEngine.inc
| ... | ... | @@ -41,13 +41,19 @@ class SubscriptionEngine { |
| 41 | 41 | |
| 42 | 42 | // if the subscription type is document, fire the folder subscriptions also |
| 43 | 43 | if ($iSubscriptionType == SubscriptionConstants::subscriptionType("DocumentSubscription")) { |
| 44 | + $default->log->info("SubscriptionEngine::fireSubscription firing folder subscriptions for the document subscription, id=$iExternalID"); | |
| 44 | 45 | $oDocument = & Document::get($iExternalID); |
| 45 | - $default->log->debug("document=$oDocument"); | |
| 46 | - $iSubscriptionsSent = SubscriptionEngine::fireSubscription($oDocument->getFolderID(), | |
| 47 | - $iSubscriptionAlertType, | |
| 48 | - SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 49 | - $aValues); | |
| 50 | - $default->log->info("fired folder subscribers, count=$iSubscriptionsSent"); | |
| 46 | + if ($oDocument) { | |
| 47 | + $default->log->debug("document=$oDocument"); | |
| 48 | + $iSubscriptionsSent = SubscriptionEngine::fireSubscription($oDocument->getFolderID(), | |
| 49 | + $iSubscriptionAlertType, | |
| 50 | + SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 51 | + $aValues); | |
| 52 | + $default->log->info("fired folder subscribers, count=$iSubscriptionsSent"); | |
| 53 | + } else { | |
| 54 | + $default->log->error("SubscriptionEngine::fireSubscription could not retrieve document from db, id=$iExternalID"); | |
| 55 | + $default->log->error("SubscriptionEngine::fireSubscription not firing folder subscriptions for the parent folder of this document"); | |
| 56 | + } | |
| 51 | 57 | } |
| 52 | 58 | $default->log->info("subscribers=" . arrayToString($aSubscribers)); |
| 53 | 59 | ... | ... |