[Favorite] Properly trigger DisfavorNotice on profile deletion
This commit is contained in:
		@@ -138,14 +138,18 @@ class Fave extends Managed_DataObject
 | 
				
			|||||||
        $result = null;
 | 
					        $result = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            if ($this->find()) {
 | 
				
			||||||
 | 
					                while ($this->fetch()) {
 | 
				
			||||||
                    $profile = $this->getActor();
 | 
					                    $profile = $this->getActor();
 | 
				
			||||||
                    $notice  = $this->getTarget();
 | 
					                    $notice  = $this->getTarget();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (Event::handle('StartDisfavorNotice', array($profile, $notice, &$result))) {
 | 
					                    if (Event::handle('StartDisfavorNotice', [$profile, $notice, &$result])) {
 | 
				
			||||||
                        $result = parent::delete($useWhere);
 | 
					                        $result = parent::delete($useWhere);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if ($result !== false) {
 | 
					                        if ($result !== false) {
 | 
				
			||||||
                    Event::handle('EndDisfavorNotice', array($profile, $notice));
 | 
					                            Event::handle('EndDisfavorNotice', [$profile, $notice]);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } catch (NoResultException $e) {
 | 
					        } catch (NoResultException $e) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user