Page MenuHomePhabricator

$wgNamespaceContentModel and populateContentModel.php have no effect
Closed, InvalidPublicBUG REPORT

Description

Steps to Reproduce:

  • Just did a migration from 1.31 to 1.34
  • In the migration process towards Multi-Content Revisions, the content model of NS_TALK pages was reset to wikitext. However the content model of NS_USER_TALK and other talk namespaces was correctly migrated (in this case, flow-board)
  • In LocalSettings.php, $wgNamespaceContentModels[NS_TALK] = 'flow-board'; is set
  • running php maintenance/populateContentModel.php -- ns=1 on table, revision and archive has no effect.

Actual Results:

Pages in NS_TEXT are still displayed using wikitext ContentHandler.

Expected Results:

Pages in NS_TEXT should be displayed using the flow-board ContentHandler.

Thoughts:

This bug has two issues:

  1. Migration was not correctly done since NS_TALK's contentHandler was reset to wikitext during migration.
  2. populateContentModel.php was not updated to reflect changes in content model handling introduced in MW > 1.31. Setting $wgNamespaceContentModel and running it has no effect.

On inspection of a content table row for a NS_TALK page, the content_model field is set to 1, which is the id for wikitext. However, rev_content_model in the table revision is set to flow-board ( from what I understand revision.rev_content_model was dropped in favor of content.content_model) For NS_USER_TALK content.content_model is correctly set to 3.

Note:
This does not appear to be a problem with the Flow extension but rather a problem of MediaWiki core migration and handling of ContentHandler. Forcing 'flow-board' in WikiPage::getContentModel() fixes the issue.

Event Timeline

Well ... the issue disappeared with erasing the current DB, grabbing a backup and going through the update process again.

It may have been an extension I forgot to update or something... Shame on me for not having had the reflex of testing the issue on a clean migrated database.