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

Change TitleExtension to PageContentExtension #7369

Merged
merged 45 commits into from
Nov 30, 2022

Conversation

marksweb
Copy link
Member

Description

This is a major change.

Currently we have a TitleExtension which hooks up PageContent. We've talked about how this should have been changed in the early days of v4, so I've done it now before we actually get to the point of official release to avoid it being something we wish we'd done but didn't.

Copy link
Contributor

@Aiky30 Aiky30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marksweb Having had the time to think about this:

I think this change will also need to come along at the same time as djangocms-versioning, this is because the djangocms-versioning monkey patches rely on title_cache and get_title_obj.

It might be worth having a smaller PR just for TitleExtension to PageContentExtension renaming to allow that to come in quicker. As soon as you merge this you lose djangocms-versioning.

cms/api.py Outdated
@@ -204,7 +204,7 @@ def create_title(language, title, page, menu_title=None, slug=None,
created_by='python-api', soft_root=False, in_navigation=False,
template=TEMPLATE_INHERITANCE_MAGIC,
limit_visibility_in_menu=constants.VISIBILITY_ALL,
xframe_options=constants.X_FRAME_OPTIONS_INHERIT):
xframe_options=constants.X_FRAME_OPTIONS_INHERIT): # TODO: Deprecate this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes this much easier without changing the create_title api as you have done. We will need a plan of how we could replace this in the future, it will affect all internal tests, and if we have 2 at the same time the tests would need to cover both too. Very ugly.

This was left alone due to the sheer amount of changes that would be required to every other package and every other packages test suite.

@marksweb
Copy link
Member Author

marksweb commented Sep 2, 2022

@Aiky30 thanks for taking a look. I've got a PR on versoning to bring support for this change. So the two can come into play together. It'll just need a plan for how best to do that.

Conflicts:
	cms/admin/pageadmin.py
	cms/extensions/__init__.py
	cms/templatetags/cms_tags.py
	cms/test_utils/project/extensionapp/admin.py
	cms/test_utils/project/extensionapp/cms_toolbars.py
	cms/test_utils/project/extensionapp/models.py
	cms/tests/test_admin.py
	cms/tests/test_apphooks.py
	cms/tests/test_extensions.py
@marksweb
Copy link
Member Author

@fsbraun I'm currently installing from develop-4 and versioning from master. So when this merges, before my next build, I'll need a support branch here before this change or versioning merging to master as well.

@marksweb
Copy link
Member Author

@fsbraun So I updated the branch and resolved the conflicts, but something in that commit has destroyed the test results 😬

@fsbraun
Copy link
Sponsor Member

fsbraun commented Nov 25, 2022

@marksweb It seems that the merge sneaked in title_cache again:
image

@marksweb
Copy link
Member Author

@fsbraun Oh well spotted! That wasn't part of the conflicts either so I missed it.

@fsbraun fsbraun merged commit d3615ee into django-cms:develop-4 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants