Even though it is an edge-case, some sites may allow translation groups to be
composed of different classes. In that case, Translatable->getTranslations()
should still work.
Also, this commit adds a helper function for testing two array for equality
where you don't care about the order of the elements. This cleaned up a lot
of copy and paste boilerplate code that was sorting arrays to test.
If the locale-filter was disabled before calling the method, it would be
enabled after calling getTranslations, this commit now only re-enabled
the locale-filter if it was enabled before calling the method...
This builds on 44f8180110, but reverts most of it.
The changeset had a logical flaw where it stored state
on the Translatable extension where it was specific to a FieldList.
This meant side effects when getCMSFields() was called more than once,
such as in the CMSSettingsController template.
Note: We shouldn't need to call getCMSFields() more than once
because its an expensive call, but that's a missing feature
in the template caching layer rather than a problem with the
Translatable extension.
UPDATED: Cleanup and refactoring to make more readable
UPDATED: Translation of siteconfig now better handles singleton(SiteConfig)
UPDATED: Renamed populateSiteConfig to populateSiteConfigDefaults to better reflect its purpose
FIXED: Parameter typing on getStagingSiteConfig
bla
The redirect to pages overview was not working because the pages overview and page edit views
share the same session namespace, and therefore the checks to see if we need to redirect to
pages overview (i.e. if there is a translated record for the current page) matched also for
the redirected request.
Fixed by checking if we already are on the CMSPagesController before redirecting to it.
When editing a page in the default locale, a double ajax request was done for the editing page.
This was caused by no locale-parameter being set in this case, which caused the default locale
parameter to be added and a new ajax request was made due to this. The extra ajax request caused
the loading-animation to appear after the edit page was loaded, which looks weird.
Fixed by doing a redirect immediately the CMSPagesController is loaded and no locale is set, so
that the default locale parameter gets set at this stage.
This subtly changes the caching behaviour
where get_one() calls are replaced, results
will be no longer cached. There's no built-in core
way to cache DataList results, so for now we accept
that there's less caching due to this internal change.
Ignore the extension's init() method being called on
LeftAndMain base class,
which is the case when requests are first routed through
AdminRootController
as an intermediary rather than the endpoint controller
The site tree sidebar was not updated when creating a new translation,
due to only CurrentForm and Breadcrumbs fragments being updated by default.
Fixed by explicitly setting the X-Pjax response header to Content on
translation creation.