Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIRAVATA-3698 management command to fix up the content type id in page revision json #186

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

machristie
Copy link
Contributor

The content type id in the wagtailcore_pagerevision.content_json column doesn't match the page's actual content type. when the page was imported from a wagtail export. The reason is that the content type ids were different in the Django instance where the Wagtail pages were developed and exported from. This causes at least a couple problems:

  • it causes an issue when migrating from wagtail 3.0 -> 4.0 (see comment on AIRAVATA-3698)
  • it causes an issue with saving revisions, causing them to sometimes fail to save which can result in history and data loss.

This PR adds a management command (fix_page_revision_content_type) that will programmatically look for and fix up any content_json that has a content_type id that doesn't match the page's actual content type. Additionally, this PR automatically calls fix_page_revision_content_type after loading a Wagtail export. This should prevent this issue from resurfacing.

@machristie machristie merged commit 75ff283 into master Sep 25, 2023
14 checks passed
@machristie machristie deleted the AIRAVATA-3698-fix-page-revision-content-type branch September 25, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant