django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
33 stars 29 forks source link

Rework the Page toolbar to use PageContent preview links, the change allows more control in the future #223

Closed Aiky30 closed 4 years ago

Aiky30 commented 4 years ago

Fixes an issue where trying to edit draft content using the language selector in the toolbar tries to redirect the user to the live URL which is not yet published, we should always use the preview url as this endpoint can cater for all eventualities.

Reworked the page toolbar to override it rather than hacking it via a monkey patch, this also gives versioning much more control over the toolbar for future upcoming changes.

The issue: When using the toolbar "Language" menu to navigate to a page that is a draft i.e. never been published, the URL is the live URL of the page, whereas it should use the placeholder preview endpoint that will always render!

Steps to replicate:

  1. Create a new draft page in one language
  2. View the page with the toolbar enabled
  3. Select the toolbar drop down selector labelled "Language"
  4. Click on a Language in the selector
SydorenkoSergiy commented 4 years ago

Checked. The issue is fixed