Skip to content

Commit

Permalink
Merge branch 'release/3.10.x' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/frontend.yml
#	CHANGELOG.rst
#	docs/upgrade/3.10.0.rst
#	package-lock.json
#	package.json
  • Loading branch information
marksweb committed May 24, 2022
2 parents 00ab32c + 1cb3dc5 commit ce8b47e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
21 changes: 10 additions & 11 deletions CHANGELOG.rst
Expand Up @@ -5,6 +5,9 @@ Changelog
unreleased
==========

* Added dark mode support to css
* Fix publishing of static placeholders outside of CMS pages
* Allow to override the template rendered after a plugin has been saved.

3.10.0 (2022-03-26)
===================
Expand Down Expand Up @@ -72,10 +75,6 @@ With the review help of the following contributors:

Thanks to all contributors for their efforts!

* Added dark mode support to css
* Fix publishing of static placeholders outside of CMS pages
* Allow to override the template rendered after a plugin has been saved.

3.9.0 (2021-06-30)
==================

Expand Down Expand Up @@ -122,7 +121,7 @@ Bug Fixes:
* Fix styles issues, caused by switching to the ``display: flex`` on the page tree renderer.
* Fixed missing builtin arguments on main ``cms`` management command causing it to crash
* Fixed template label nested translation
* Fixed a bug where the fallback page title would be returned instead of the one from the current language
* Fixed a bug where the fallback page title whould be returned instead of the one from the current language
* Fixed an issue when running migrations on a multi database project
* Fixes #7033: also check for Django 3.2, now that 3.9 supports it. (#7054) (02083f2dc) -- Marco Bonetti

Expand Down Expand Up @@ -223,7 +222,7 @@ Thanks to all contributors for their efforts!
* Fixed an issue in ``wizards/create.html`` where the error message did not use the plural form
* Improved documentation building
* Updated the content for django CMS’s development community
* Replaced all occurrences of ``force_text`` and ``smart_text`` against
* Replaced all occurences of ``force_text`` and ``smart_text`` against
``force_str``and ``smart_str``.


Expand Down Expand Up @@ -761,7 +760,7 @@ Thanks to all contributors for their efforts!
- Substantial improvements to the page tree and significant reduction of reloads
- Update jsTree version to 3.2.1 with slight adaptions to the Pagetree
- Documentation improvements
- Improve the display and usability of the language menu, especially in cases
- Improve the display and useability of the language menu, especially in cases
where there are many languages.
- Fix an issue relating to search fields in plugins
- Fix an issue where the app-resolver would trigger locales into migrations
Expand Down Expand Up @@ -1075,7 +1074,7 @@ Thanks to all contributors for their efforts!
- Improves redirection as a result of changes to page slugs, etc.
- Improves performance of "watched models"
- Improves frontend performance relating to resizing the sideframe
- Corrects an issue where items might not be visible in structure mode menus
- Corrects an issue where items might not be visible in structue mode menus
- Limits version of django-mptt used in CMS for 3.0.x
- Prevent accidental upgrades to Django 1.8, which is not yet supported

Expand Down Expand Up @@ -1132,7 +1131,7 @@ Thanks to all contributors for their efforts!
==================

- Add require_parent option to CMS_PLACEHOLDER_CONF
- Fix django-mptt version dependency to be PEP440 compatible
- Fix django-mptt version depenency to be PEP440 compatible
- Fix some Django 1.4 compatibility issues
- Add toolbar sanity check
- Fix behavior with CMSPluginBase.get_render_template()
Expand Down Expand Up @@ -1160,7 +1159,7 @@ Thanks to all contributors for their efforts!
- Fixes PageField to work in Django 1.7 environments
- Updates to community and project governance documentation
- Added list of retired core developers
- Added branch policy documentation
- Added branch policy documentaion


3.0.6 (2014-10-07)
Expand Down Expand Up @@ -1370,7 +1369,7 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
- CMS_FRONTEND_LANGUAGES limits django languages as well during language selection
- Wymeditor updated to 1.0.4a
- icon_url escape fixed
- Ukrainian translation added
- Ukranian translation added
- Fixed wrong language prefix handling for form actions and admin preview
- Admin icons in django 1.4 fixed
- Added requirements.txt for pip and testing in test_requirements
Expand Down
23 changes: 16 additions & 7 deletions cms/middleware/language.py
Expand Up @@ -2,6 +2,8 @@
from django.utils.deprecation import MiddlewareMixin
from django.utils.translation import get_language

from cms.utils.compat import DJANGO_3_0


class LanguageCookieMiddleware(MiddlewareMixin):
def __init__(self, get_response):
Expand All @@ -18,14 +20,21 @@ def __call__(self, request):
# To ensure support of very old browsers, Django processed automatically "expires" according to max_age value.
# https://docs.djangoproject.com/en/3.2/ref/request-response/#django.http.HttpResponse.set_cookie

cookie_kwargs = {
'value': language,
'domain': settings.LANGUAGE_COOKIE_DOMAIN,
'max_age': settings.LANGUAGE_COOKIE_AGE or 365 * 24 * 60 * 60, # 1 year
'path': settings.LANGUAGE_COOKIE_PATH,
}
if DJANGO_3_0:
cookie_kwargs.update({
'httponly': settings.LANGUAGE_COOKIE_HTTPONLY,
'samesite': settings.LANGUAGE_COOKIE_SAMESITE,
'secure': settings.LANGUAGE_COOKIE_SECURE,
})

response.set_cookie(
settings.LANGUAGE_COOKIE_NAME,
value=language,
domain=settings.LANGUAGE_COOKIE_DOMAIN,
max_age=settings.LANGUAGE_COOKIE_AGE or 365 * 24 * 60 * 60, # 1 year
httponly=settings.LANGUAGE_COOKIE_HTTPONLY,
path=settings.LANGUAGE_COOKIE_PATH,
samesite=settings.LANGUAGE_COOKIE_SAMESITE,
secure=settings.LANGUAGE_COOKIE_SECURE,
**cookie_kwargs
)
return response
4 changes: 2 additions & 2 deletions cms/toolbar/toolbar.py
Expand Up @@ -326,10 +326,10 @@ def get_object_draft_url(self):
with force_language(self.request_language):
try:
return self.obj.get_draft_url()
except NoReverseMatch:
except (NoReverseMatch, AttributeError):
try:
return self.obj.get_absolute_url()
except NoReverseMatch:
except (NoReverseMatch, AttributeError):
pass
return ''

Expand Down
2 changes: 1 addition & 1 deletion docs/upgrade/3.10.0.rst
Expand Up @@ -49,7 +49,7 @@ Bug Fixes:
* Fix styles issues, caused by switching to the ``display: flex`` on the page tree renderer.
* Fixed missing builtin arguments on main ``cms`` management command causing it to crash
* Fixed template label nested translation
* Fixed a bug where the fallback page title would be returned instead of the one from the current language
* Fixed a bug where the fallback page title would be returned instead of the one from the current language
* Fixed an issue when running migrations on a multi database project


Expand Down

0 comments on commit ce8b47e

Please sign in to comment.