Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Adapters/DatabasePersistentPageIdentifiersRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getPersistentIds( array $pageIds ): array {
$result = $this->database->newSelectQueryBuilder()
->select( [ 'p.page_id', 'ppi.persistent_id' ] )
->from( 'page', 'p' )
// Join is necessary to exclude pages deleted from the `page` table, but not `persistent_page_ids`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the better behavior? And if it is, what about the newly added method? Should we re-add the join there?

Copy link
Contributor Author

@malberts malberts May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one use case I can think of where returning deleted IDs might be useful: if you only know the persistent ID and you want to undelete the page. Not sure if there's anything else somebody might want to do with a deleted page ID.

The join is not strictly necessary in the new code, because it does an implicit page existence check (via Title::newFromID()) before redirecting.

However, if we decide that the "get deleted ID to undelete" use case is necessary, then the new special page should probably also redirect to the deleted page.

->leftJoin( 'persistent_page_ids', 'ppi', 'p.page_id = ppi.page_id' )
->where( [ 'p.page_id' => $pageIds ] )
->orderBy( 'p.page_id' )
Expand Down