Skip to content

Commit 11f6737

Browse files
committed
[TASK] Harden pagevisit listing by not listing non-existent pages
Because of data garbabe (calls from different crawler) could lead to garbage (non exising values in tx_lux_domain_model_pagevisit with .page=0). This commit ignores those values in Analysis/Content&Downloads
1 parent 4f6e262 commit 11f6737

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Classes/Domain/Repository/PagevisitRepository.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
namespace In2code\Lux\Domain\Repository;
55

66
use DateTime;
7-
use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver;
87
use Doctrine\DBAL\Exception as ExceptionDbal;
98
use Exception;
109
use In2code\Lux\Domain\Model\Categoryscoring;
@@ -47,7 +46,6 @@ class PagevisitRepository extends AbstractRepository
4746
* @return array
4847
* @throws ExceptionDbal
4948
* @throws Exception
50-
* @throws ExceptionDbalDriver
5149
*/
5250
public function findCombinedByPageIdentifier(FilterDto $filter, int $limit = 100): array
5351
{
@@ -56,7 +54,7 @@ public function findCombinedByPageIdentifier(FilterDto $filter, int $limit = 100
5654
. ' left join ' . Page::TABLE_NAME . ' p on p.uid = pv.page'
5755
. ' left join ' . Visitor::TABLE_NAME . ' v on v.uid = pv.visitor'
5856
. ' left join ' . Categoryscoring::TABLE_NAME . ' cs on v.uid = cs.visitor'
59-
. ' where 1 '
57+
. ' where pv.page > 0 '
6058
. $this->extendWhereClauseWithFilterSearchterms($filter, 'p')
6159
. $this->extendWhereClauseWithFilterTime($filter, true, 'pv')
6260
. $this->extendWhereClauseWithFilterSite($filter, 'pv')
@@ -328,7 +326,6 @@ public function findAmountPerPageAndVisitor(int $pageIdentifier, Visitor $visito
328326
* @param int $limit
329327
* @return array
330328
* @throws ExceptionDbal
331-
* @throws ExceptionDbalDriver
332329
*/
333330
public function getAmountOfReferrers(FilterDto $filter, int $limit = 100): array
334331
{
@@ -505,6 +502,7 @@ public function getReferrerCategoryAmounts(FilterDto $filter): array
505502
* @param FilterDto $filter
506503
* @return array
507504
* @throws Exception
505+
* @throws ExceptionDbal
508506
*/
509507
public function getDomainsWithAmountOfVisits(FilterDto $filter): array
510508
{
@@ -517,7 +515,7 @@ public function getDomainsWithAmountOfVisits(FilterDto $filter): array
517515
. $this->extendWhereClauseWithFilterScoring($filter, 'v')
518516
. $this->extendWhereClauseWithFilterCategoryScoring($filter, 'cs')
519517
. ' group by domain order by count desc';
520-
return (array)$connection->executeQuery($sql)->fetchAllAssociative();
518+
return $connection->executeQuery($sql)->fetchAllAssociative();
521519
}
522520

523521
/**
@@ -529,6 +527,7 @@ public function getDomainsWithAmountOfVisits(FilterDto $filter): array
529527
* @param FilterDto $filter
530528
* @return array
531529
* @throws Exception
530+
* @throws ExceptionDbal
532531
*/
533532
public function getAllDomains(FilterDto $filter): array
534533
{
@@ -547,6 +546,7 @@ public function getAllDomains(FilterDto $filter): array
547546
* @param FilterDto $filter
548547
* @return array
549548
* @throws Exception
549+
* @throws ExceptionDbal
550550
*/
551551
public function getAllLanguages(FilterDto $filter): array
552552
{
@@ -567,6 +567,7 @@ public function getAllLanguages(FilterDto $filter): array
567567
* @param FilterDto $filter
568568
* @return int
569569
* @throws Exception
570+
* @throws ExceptionDbal
570571
*/
571572
public function findAbandonsForPage(int $pageIdentifier, FilterDto $filter): int
572573
{

0 commit comments

Comments
 (0)