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:
Create a new draft page in one language
View the page with the toolbar enabled
Select the toolbar drop down selector labelled "Language"
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: