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 );
74 $base = $title->getPrefixedText();
75 $bundle = $this->getValidBundleFromTitle( $title, $isTranslation );
76 $bundleType = get_class( $bundle );
78 foreach ( $subpageList[
'translationPages' ] as $old ) {
79 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
80 $old, $base, $bundleType, $isTranslation, $user, $reason
84 foreach ( $subpageList[
'translationUnitPages' ] as $old ) {
85 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
86 $old, $base, $bundleType, $isTranslation, $user, $reason
90 if ( $deleteSubpages ) {
91 foreach ( $subpageList[
'normalSubpages' ] as $old ) {
92 $jobs[$old->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
93 $old, $base, $bundleType, $isTranslation, $user, $reason
98 if ( !$isTranslation ) {
99 $jobs[$title->getPrefixedText()] = DeleteTranslatableBundleJob::newJob(
100 $title, $base, $bundleType,
false, $user, $reason
104 $this->jobQueueGroup->push( $jobs );
106 $this->mainCache->set(
107 $this->mainCache->makeKey(
'pt-base', $title->getPrefixedText() ),
109 6 * $this->mainCache::TTL_HOUR
112 if ( !$isTranslation ) {
113 $this->bundleFactory->getStore( $bundle )->delete( $title );
117 private function getValidBundleFromTitle( Title $bundleTitle,
bool $isTranslation ): TranslatableBundle {