Project

General

Profile

Actions

Task #105873

open

Should always store page id in tx_linkvalidator_broken_links not pid

Added by Sybille Peters 13 days ago.

Status:
New
Priority:
Should have
Category:
Linkvalidator
Target version:
-
Start date:
2025-01-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
14
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The tx_linkvalidator_broken_links.record_pid always contains the pid of the content record. For pages, this is inconvenient because we need the uid, not the pid. We always need the page id.

It would be better if we generally store the page id instead of the pid.

The current state requires a lot of awkward DB queries where we have to consider pages and non-pages seperately:

For example:

->where(
                    $queryBuilder->expr()->or(
                        $queryBuilder->expr()->and(
                            $queryBuilder->expr()->in(
                                'record_uid',
                                $queryBuilder->quoteArrayBasedValueListToIntegerList($pageIdsChunk)
                            ),
                            $queryBuilder->expr()->eq('table_name', $queryBuilder->quote('pages'))
                        ),
                        $queryBuilder->expr()->and(
                            $queryBuilder->expr()->in(
                                'record_pid',
                                $queryBuilder->quoteArrayBasedValueListToIntegerList($pageIdsChunk)
                            ),
                            $queryBuilder->expr()->neq('table_name', $queryBuilder->quote('pages'))
                        )
                    )

https://github.com/TYPO3/typo3/blob/83a4a08b2a47534746593ae23f0d6e870f714f53/typo3/sysext/linkvalidator/Classes/Repository/BrokenLinkRepository.php#L107C17-L123C22

 $constraints = [
                $queryBuilder->expr()->or(
                    $queryBuilder->expr()->and(
                        $queryBuilder->expr()->in(
                            'record_uid',
                            $queryBuilder->quoteArrayBasedValueListToIntegerList($pageIdsChunk)
                        ),
                        $queryBuilder->expr()->eq('table_name', $queryBuilder->quote('pages'))
                    ),
                    $queryBuilder->expr()->and(
                        $queryBuilder->expr()->in(
                            'record_pid',
                            $queryBuilder->quoteArrayBasedValueListToIntegerList($pageIdsChunk)
                        ),
                        $queryBuilder->expr()->neq('table_name', $queryBuilder->quote('pages'))
                    )
                ),

https://github.com/TYPO3/typo3/blob/83a4a08b2a47534746593ae23f0d6e870f714f53/typo3/sysext/linkvalidator/Classes/Repository/BrokenLinkRepository.php#L266C12-L282C19

etc. ....


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #105413: Linkvalidator BE-Module wrong permissions for invalid links in page attributesUnder ReviewSybille Peters2024-10-23

Actions
Actions #1

Updated by Sybille Peters 13 days ago

  • Related to Bug #105413: Linkvalidator BE-Module wrong permissions for invalid links in page attributes added
Actions

Also available in: Atom PDF