Closed jrief closed 9 months ago
@jrief If I look at this it seems that the logic of copying extensions should be invoked by something like
new_extension = old_extension.copy(new_content_object, language=new_content_object.langauge)
copy
will call copy_relations
.
Already the current versioning code replicates code from the core.
In a separate PR I'd suggest to remove to deprecate the language parameter since it is not needed. (It's essentially passed on to the copy_relations
function.)
In order to get this functionality working, we have to patch django-cms first and make the language parameter optional.
I'm unsure about the copy
-method,….objects.create(**extension_fields)
already copies the object, so what's the intention of a separate copy
method?
We can leave it just in case it has to be overridden, but usually it can remain a noop, except for invoking copy_relations
.
It’s already there , just needs to be called. Versioning duplicates it incorrectly (.objects.create
) and will conflict with any extension that overrides it’s copy method.
Should be fixed by #344. If not, please reopen.
Description
Details on this can be found in #342.
Running tests on this PR will fail, because the signature of the CMS's PageContentExtension.copy_relations() does not fit here.
This has to be changed first in the
devel_4
branch of django-cms itself.Related resources
This fixes #342
Checklist
master
Unit tests are pending. See above for the reason.