ReactionModel: Remove check for allowed reaction types
- The checks are not needed - Returning NULL throws a notice in foreach when passed into RenderReactionList/RenderReactionRecord - This makes the ReactionModel more generic so it can be used with custom reaction types
This commit is contained in:
parent
6f7bbb00bc
commit
d025166280
@ -75,7 +75,7 @@ class ReactionModel extends Gdn_Model {
|
||||
if (array_key_exists($Type . $ID, self::$_Reactions)) {
|
||||
return self::$_Reactions[$Type . $ID];
|
||||
}
|
||||
else if (in_array($Type, array('discussion', 'comment', 'activity')) && $ID > 0) {
|
||||
else {
|
||||
$Result = $this->SQL
|
||||
->Select('a.*, r.InsertUserID as UserID, r.DateInserted')
|
||||
->From('Action a')
|
||||
@ -88,9 +88,6 @@ class ReactionModel extends Gdn_Model {
|
||||
self::$_Reactions[$Type . $ID] = $Result;
|
||||
return $Result;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user