Commit ee2df3c9 authored by Ben's avatar Ben
Browse files

added in handling for groups fixing #806

parent c736d788
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -55,9 +55,15 @@ class Repository
        
        $set = new Set(Type::bigint());
        $set->add(new Bigint($report->getReporterGuid()));
        
        $entity = $report->getReport()->getEntity();
        $guid = $report->getReport()->getEntityOwnerGuid();
        if ($entity->getType() === "group") {
            $guid = $entity->getOwnerObj()->getGuid();
        }
        $values = [
            $set,
            new Bigint($report->getReport()->getEntityOwnerGuid()),
            new Bigint($guid),
        ];

        if ($report->getReporterHash()) {
+5 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Spec\Minds\Core\Reports\UserReports;
use Minds\Core\Reports\UserReports\Repository;
use Minds\Core\Reports\UserReports\UserReport;
use Minds\Core\Reports\Report;
use Minds\Entities\Entity;
use Minds\Core\Data\Cassandra\Client;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
@@ -41,6 +42,9 @@ class RepositorySpec extends ObjectBehavior
            ->shouldBeCalled()
            ->willReturn(true);

        $entity = new Entity();
        $entity->type = "activity";

        $userReport->getReport()
            ->shouldBeCalled()
            ->willReturn((new Report)
@@ -48,6 +52,7 @@ class RepositorySpec extends ObjectBehavior
                ->setTimestamp($ts)
                ->setReasonCode(2)
                ->setSubReasonCode(4)
                ->setEntity($entity)
            );
        
        $userReport->getReporterGuid()