|
30 | 30 | use In2code\In2publishCore\Domain\Model\Record;
|
31 | 31 | use In2code\In2publishCore\Domain\Model\RecordInterface;
|
32 | 32 | use In2code\In2publishCore\Domain\Service\ReplaceMarkersService;
|
33 |
| -use In2code\In2publishCore\Utility\ArrayUtility; |
34 | 33 | use In2code\In2publishCore\Utility\DatabaseUtility;
|
35 | 34 | use In2code\In2publishCore\Utility\FileUtility;
|
36 | 35 | use TYPO3\CMS\Core\Database\DatabaseConnection;
|
@@ -471,59 +470,17 @@ public function enrichPageRecord(Record $record, array $excludedTableNames)
|
471 | 470 | }
|
472 | 471 | $recordIdentifier = $record->getIdentifier();
|
473 | 472 | foreach ($this->tcaService->getAllTableNames($excludedTableNames) as $tableName) {
|
474 |
| - if (!$this->skipRecordRelation($tableName, $record)) { |
475 |
| - if ($this->shouldSkipSearchingForRelatedRecordByTable($record, $tableName)) { |
476 |
| - continue; |
477 |
| - } |
478 |
| - $previousTableName = $this->replaceTableName($tableName); |
479 |
| - $record->addRelatedRecords($this->findByProperty('pid', $recordIdentifier)); |
480 |
| - $this->tableName = $previousTableName; |
481 |
| - } else { |
482 |
| - $this->logger->debug( |
483 |
| - 'Records in this page skipped because of "skipRecordsIfNoPageChange"', |
484 |
| - array('page' => $recordIdentifier, 'tableName' => $tableName) |
485 |
| - ); |
| 473 | + if ($this->shouldSkipSearchingForRelatedRecordByTable($record, $tableName)) { |
| 474 | + continue; |
486 | 475 | }
|
| 476 | + $previousTableName = $this->replaceTableName($tableName); |
| 477 | + $relatedRecords = $this->findByProperty('pid', $recordIdentifier); |
| 478 | + $record->addRelatedRecords($relatedRecords); |
| 479 | + $this->tableName = $previousTableName; |
487 | 480 | }
|
488 | 481 | return $record;
|
489 | 482 | }
|
490 | 483 |
|
491 |
| - /** |
492 |
| - * Check if this content relation could be skipped by looking into the last sys_log entry for the current page and |
493 |
| - * compare local and foreign. If there are no differences, relation could be skipped |
494 |
| - * |
495 |
| - * @param string $tableName |
496 |
| - * @param Record $record |
497 |
| - * @return bool |
498 |
| - */ |
499 |
| - protected function skipRecordRelation($tableName, Record $record) |
500 |
| - { |
501 |
| - if ($record->isPagesTable() && $tableName !== 'pages') { |
502 |
| - // check if this test wasn't done before |
503 |
| - if (!array_key_exists($record->getIdentifier(), $this->skipRecords)) { |
504 |
| - $localLog = $this->findLastPropertiesByPropertyAndTableName( |
505 |
| - $this->localDatabase, |
506 |
| - 'sys_log', |
507 |
| - 'event_pid', |
508 |
| - $record->getIdentifier() |
509 |
| - ); |
510 |
| - $foreignLog = $this->findLastPropertiesByPropertyAndTableName( |
511 |
| - $this->foreignDatabase, |
512 |
| - 'sys_log', |
513 |
| - 'event_pid', |
514 |
| - $record->getIdentifier() |
515 |
| - ); |
516 |
| - $differences = ArrayUtility::compareArrays($localLog, $foreignLog, array('uid')); |
517 |
| - $result = empty($differences); |
518 |
| - $this->skipRecords[$record->getIdentifier()] = $result; |
519 |
| - return $result; |
520 |
| - } else { |
521 |
| - return $this->skipRecords[$record->getIdentifier()]; |
522 |
| - } |
523 |
| - } |
524 |
| - return false; |
525 |
| - } |
526 |
| - |
527 | 484 | /**
|
528 | 485 | * @param Record $record
|
529 | 486 | * @param array $columnConfiguration
|
|
0 commit comments