From 96c50809e37d253c89e7e08ca9ff3a634d224542 Mon Sep 17 00:00:00 2001 From: Oliver Eglseder Date: Fri, 9 Sep 2016 11:20:00 +0200 Subject: [PATCH] [CLEANUP] Remove deprecated feature skipRecordsIfNoPageChange --- .../Domain/Repository/CommonRepository.php | 55 ++----------------- 1 file changed, 6 insertions(+), 49 deletions(-) diff --git a/Classes/Domain/Repository/CommonRepository.php b/Classes/Domain/Repository/CommonRepository.php index 6b4999608..26b68c564 100755 --- a/Classes/Domain/Repository/CommonRepository.php +++ b/Classes/Domain/Repository/CommonRepository.php @@ -30,7 +30,6 @@ use In2code\In2publishCore\Domain\Model\Record; use In2code\In2publishCore\Domain\Model\RecordInterface; use In2code\In2publishCore\Domain\Service\ReplaceMarkersService; -use In2code\In2publishCore\Utility\ArrayUtility; use In2code\In2publishCore\Utility\DatabaseUtility; use In2code\In2publishCore\Utility\FileUtility; use TYPO3\CMS\Core\Database\DatabaseConnection; @@ -471,59 +470,17 @@ public function enrichPageRecord(Record $record, array $excludedTableNames) } $recordIdentifier = $record->getIdentifier(); foreach ($this->tcaService->getAllTableNames($excludedTableNames) as $tableName) { - if (!$this->skipRecordRelation($tableName, $record)) { - if ($this->shouldSkipSearchingForRelatedRecordByTable($record, $tableName)) { - continue; - } - $previousTableName = $this->replaceTableName($tableName); - $record->addRelatedRecords($this->findByProperty('pid', $recordIdentifier)); - $this->tableName = $previousTableName; - } else { - $this->logger->debug( - 'Records in this page skipped because of "skipRecordsIfNoPageChange"', - array('page' => $recordIdentifier, 'tableName' => $tableName) - ); + if ($this->shouldSkipSearchingForRelatedRecordByTable($record, $tableName)) { + continue; } + $previousTableName = $this->replaceTableName($tableName); + $relatedRecords = $this->findByProperty('pid', $recordIdentifier); + $record->addRelatedRecords($relatedRecords); + $this->tableName = $previousTableName; } return $record; } - /** - * Check if this content relation could be skipped by looking into the last sys_log entry for the current page and - * compare local and foreign. If there are no differences, relation could be skipped - * - * @param string $tableName - * @param Record $record - * @return bool - */ - protected function skipRecordRelation($tableName, Record $record) - { - if ($record->isPagesTable() && $tableName !== 'pages') { - // check if this test wasn't done before - if (!array_key_exists($record->getIdentifier(), $this->skipRecords)) { - $localLog = $this->findLastPropertiesByPropertyAndTableName( - $this->localDatabase, - 'sys_log', - 'event_pid', - $record->getIdentifier() - ); - $foreignLog = $this->findLastPropertiesByPropertyAndTableName( - $this->foreignDatabase, - 'sys_log', - 'event_pid', - $record->getIdentifier() - ); - $differences = ArrayUtility::compareArrays($localLog, $foreignLog, array('uid')); - $result = empty($differences); - $this->skipRecords[$record->getIdentifier()] = $result; - return $result; - } else { - return $this->skipRecords[$record->getIdentifier()]; - } - } - return false; - } - /** * @param Record $record * @param array $columnConfiguration