48 public function getPagesForDeletion( Title $title, ?
string $languageCode,
bool $isTranslationPage ): array {
49 if ( $isTranslationPage ) {
50 $resultSet = $this->subpageBuilder->getEmptyResultSet();
55 $resultSet[
'translationPages'] = [ $title ];
56 $resultSet[
'translationUnitPages'] = $translatablePage->getTranslationUnitPages( $languageCode );
59 $bundle = $this->bundleFactory->getValidBundle( $title );
60 return $this->subpageBuilder->getSubpagesPerType( $bundle,
false );
72 array $userSessionInfo,
75 $base = $title->getPrefixedText();
76 $bundle = $this->getValidBundleFromTitle( $title, $isTranslation );
77 $bundleType = get_class( $bundle );
79 foreach ( $subpageList[
'translationPages' ] as $old ) {
80 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
81 $old, $base, $bundleType, $isTranslation, $user, $reason, $userSessionInfo
85 foreach ( $subpageList[
'translationUnitPages' ] as $old ) {
86 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
87 $old, $base, $bundleType, $isTranslation, $user, $reason, $userSessionInfo
91 if ( $deleteSubpages ) {
92 foreach ( $subpageList[
'normalSubpages' ] as $old ) {
93 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
94 $old, $base, $bundleType, $isTranslation, $user, $reason, $userSessionInfo
99 if ( !$isTranslation ) {
100 $jobs[$title->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
101 $title, $base, $bundleType,
false, $user, $reason, $userSessionInfo
105 $this->jobQueueGroup->push( $jobs );
107 $this->mainCache->set(
108 $this->mainCache->makeKey(
'pt-base', $title->getPrefixedText() ),
110 6 * $this->mainCache::TTL_HOUR
113 if ( !$isTranslation ) {
114 $this->bundleFactory->getStore( $bundle )->delete( $title );
118 private function getValidBundleFromTitle( Title $bundleTitle,
bool $isTranslation ): TranslatableBundle {