Version 5.0.0 beta 7
This commit is contained in:
1 parent
fa2a720105
commit
54d5dcd0a0
156 files changed
+4337
-2995
No files matched your search
@@ -18,6 +18,7 @@ use http\Exception\InvalidArgumentException;
|
||||
use IPS\Content\Comment;
|
||||
use IPS\Content\Filter;
|
||||
use IPS\Content\Item;
|
||||
use IPS\Content\Reaction;
|
||||
use IPS\Content\Taggable;
|
||||
use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
@@ -508,11 +509,26 @@ class Content extends Table
|
||||
{
|
||||
/* Get all reactions */
|
||||
$allReputation = $class::getMany( 'allReactions', $rows );
|
||||
$enabledReactions = [];
|
||||
foreach(Reaction::enabledReactions() as $reaction )
|
||||
{
|
||||
$enabledReactions[] = $reaction->id;
|
||||
}
|
||||
|
||||
foreach( $rows as $id => $item )
|
||||
{
|
||||
if ( isset( $allReputation[ $item->$idField ] ) )
|
||||
{
|
||||
$rows[ $id ]->reputation = $allReputation[ $item->$idField ];
|
||||
/* Filter out any reactions that may have been deleted */
|
||||
$rowReputation = [];
|
||||
foreach( $allReputation[ $item->$idField ] as $k => $v )
|
||||
{
|
||||
if( in_array( $k, $enabledReactions ) )
|
||||
{
|
||||
$rowReputation[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
$rows[ $id ]->reputation = $rowReputation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user