8000 PageContentExtension should offer hook copy_relations · Issue #342 · django-cms/djangocms-versioning · GitHub
[go: up one dir, main page]

Skip to content
PageContentExtension should offer hook copy_relations #342
Closed
@jrief

Description

@jrief

If someone extends model PageContent by creating a model inheriting from PageContentExtension, that extension only creates flat copies. This is because no hook method copy_relations is called.

I'm using a model MySpecialContent which inherits from PageContentExtension. That model has a one-to-one-relation with PageContent. PageContent is versioned using djangocms-versioning. If I create a new version of a CMS page, in the database a new row appears containing a copy of MySpecialContent. This is expected behavior.

MySpecialContent has some relations which must also be copied whenever I create a new version. CMS3 offered the method copy_relations which would perform this action. In CMS3 this method was called implicitly. In CMS4 it however is not called when creating a new copy of a PageContentExtension.

I have a patch for this. PR is coming soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0