X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22upgrade%22%2C%22reinstall=non%22%29%20.%20%22?a=blobdiff_plain;f=includes%2FStorage%2FRevisionStore.php;h=13aedbab7496dd629639fda05de3d4594251c4e1;hb=bb8c060128a79532e1b6885fb3ebd6174d3f4d4d;hp=2e3103c527a8d29f2a7ac696f68dd889a2daeb02;hpb=ff35ae61958412f22e79466a6dbab95c4d2bebd7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/RevisionStore.php b/includes/Storage/RevisionStore.php index 2e3103c527..13aedbab74 100644 --- a/includes/Storage/RevisionStore.php +++ b/includes/Storage/RevisionStore.php @@ -594,16 +594,17 @@ class RevisionStore if ( $current ) { $fields = [ - 'page' => $title->getArticleID(), - 'user_text' => $user->getName(), - 'user' => $user->getId(), - 'actor' => $user->getActorId(), - 'comment' => $comment, - 'minor_edit' => $minor, - 'text_id' => $current->rev_text_id, - 'parent_id' => $current->page_latest, - 'len' => $current->rev_len, - 'sha1' => $current->rev_sha1 + 'page' => $title->getArticleID(), + 'user_text' => $user->getName(), + 'user' => $user->getId(), + 'actor' => $user->getActorId(), + 'comment' => $comment, + 'minor_edit' => $minor, + 'text_id' => $current->rev_text_id, + 'parent_id' => $current->page_latest, + 'slot_origin' => $current->page_latest, + 'len' => $current->rev_len, + 'sha1' => $current->rev_sha1 ]; if ( $this->contentHandlerUseDB ) { @@ -635,7 +636,7 @@ class RevisionStore */ public function getRcIdIfUnpatrolled( RevisionRecord $rev ) { $rc = $this->getRecentChange( $rev ); - if ( $rc && $rc->getAttribute( 'rc_patrolled' ) == 0 ) { + if ( $rc && $rc->getAttribute( 'rc_patrolled' ) == RecentChange::PRC_UNPATROLLED ) { return $rc->getAttribute( 'rc_id' ); } else { return 0; @@ -723,11 +724,6 @@ class RevisionStore 'ar_content_model' => 'rev_content_model', ]; - if ( empty( $archiveRow->ar_text_id ) ) { - $fieldMap['ar_text'] = 'old_text'; - $fieldMap['ar_flags'] = 'old_flags'; - } - $revRow = new stdClass(); foreach ( $fieldMap as $arKey => $revKey ) { if ( property_exists( $archiveRow, $arKey ) ) { @@ -771,6 +767,11 @@ class RevisionStore $mainSlotRow->content_address = 'tt:' . $row->rev_text_id; } + // This is used by null-revisions + $mainSlotRow->slot_origin = isset( $row->slot_origin ) + ? intval( $row->slot_origin ) + : null; + if ( isset( $row->old_text ) ) { // this happens when the text-table gets joined directly, in the pre-1.30 schema $blobData = isset( $row->old_text ) ? strval( $row->old_text ) : null; @@ -798,6 +799,9 @@ class RevisionStore $mainSlotRow->slot_content_id = isset( $row['text_id'] ) ? intval( $row['text_id'] ) : null; + $mainSlotRow->slot_origin = isset( $row['slot_origin'] ) + ? intval( $row['slot_origin'] ) + : null; $mainSlotRow->content_address = isset( $row['text_id'] ) ? 'tt:' . intval( $row['text_id'] ) : null; @@ -835,9 +839,11 @@ class RevisionStore throw new MWException( 'Revision constructor passed invalid row format.' ); } - // With the old schema, the content changes with every revision. - // ...except for null-revisions. Would be nice if we could detect them. - $mainSlotRow->slot_inherited = 0; + // With the old schema, the content changes with every revision, + // except for null-revisions. + if ( !isset( $mainSlotRow->slot_origin ) ) { + $mainSlotRow->slot_origin = $mainSlotRow->slot_revision_id; + } if ( $mainSlotRow->model_name === null ) { $mainSlotRow->model_name = function ( SlotRecord $slot ) use ( $title ) { @@ -1693,7 +1699,6 @@ class RevisionStore 'ar_namespace', 'ar_title', 'ar_rev_id', - 'ar_text', 'ar_text_id', 'ar_timestamp', 'ar_minor_edit',