*/
public static function selectFields() {
global $wgContentHandlerUseDB, $wgActorTableSchemaMigrationStage;
+ global $wgMultiContentRevisionSchemaMigrationStage;
if ( $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
// If code is using this instead of self::getQueryInfo(), there's a
);
}
+ if ( !( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) {
+ // If code is using this instead of self::getQueryInfo(), there's a
+ // decent chance it's going to try to directly access
+ // $row->rev_text_id or $row->rev_content_model and we can't give it
+ // useful values here once those aren't being written anymore,
+ // and may not exist at all.
+ throw new BadMethodCallException(
+ 'Cannot use ' . __METHOD__ . ' when $wgMultiContentRevisionSchemaMigrationStage '
+ . 'does not have SCHEMA_COMPAT_WRITE_OLD set.'
+ );
+ }
+
wfDeprecated( __METHOD__, '1.31' );
$fields = [
*/
public static function selectArchiveFields() {
global $wgContentHandlerUseDB, $wgActorTableSchemaMigrationStage;
+ global $wgMultiContentRevisionSchemaMigrationStage;
if ( $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
// If code is using this instead of self::getQueryInfo(), there's a
);
}
+ if ( !( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) {
+ // If code is using this instead of self::getQueryInfo(), there's a
+ // decent chance it's going to try to directly access
+ // $row->ar_text_id or $row->ar_content_model and we can't give it
+ // useful values here once those aren't being written anymore,
+ // and may not exist at all.
+ throw new BadMethodCallException(
+ 'Cannot use ' . __METHOD__ . ' when $wgMultiContentRevisionSchemaMigrationStage '
+ . 'does not have SCHEMA_COMPAT_WRITE_OLD set.'
+ );
+ }
+
wfDeprecated( __METHOD__, '1.31' );
$fields = [
/**
* Set the title of the revision
*
- * @deprecated: since 1.31, this is now a noop. Pass the Title to the constructor instead.
+ * @deprecated since 1.31, this is now a noop. Pass the Title to the constructor instead.
*
* @param Title $title
*/
* used to determine the content model to use. If no title is know, CONTENT_MODEL_WIKITEXT
* is used as a last resort.
*
- * @todo: drop this, with MCR, there no longer is a single model associated with a revision.
+ * @todo drop this, with MCR, there no longer is a single model associated with a revision.
*
* @return string The content model id associated with this revision,
* see the CONTENT_MODEL_XXX constants.
* If no content format was stored in the database, the default format for this
* revision's content model is returned.
*
- * @todo: drop this, the format is irrelevant to the revision!
+ * @todo drop this, the format is irrelevant to the revision!
*
* @return string The content format id associated with this revision,
* see the CONTENT_FORMAT_XXX constants.
* @param stdClass $row The text data
* @param string $prefix Table prefix (default 'old_')
* @param string|bool $wiki The name of the wiki to load the revision text from
- * (same as the the wiki $row was loaded from) or false to indicate the local
+ * (same as the wiki $row was loaded from) or false to indicate the local
* wiki (this is the default). Otherwise, it must be a symbolic wiki database
* identifier as understood by the LoadBalancer class.
* @return string|false Text the text requested or false on failure