The issue causes the moved page to revert to previous location when Save and Publish before any page refresh or page switching.
This commit also adds 'Modified' badge to the moved page
jQuery seems to order by DOM rather than occurrence of
selectors, which means it always takes the last populated
field (in our case the "live" link over the "draft" link).
Goes by priority, but allows for fields to be empty.
This is important e.g. for models which are removed just
from live, or just from draft.
Also reacts to a field rename done in CMS module (62783c75).
Rather than disabling the links altogether, which is
counter-intuitive to most users.
See https://github.com/silverstripe/sapphire/pull/638.
Also hide a duplicate $SilverStripeNavigator on the previewed
website (in case it has been manually applied to the template).
Avoid ajax reloads when URLs differ in irrelevant ways,
e.g. admin/?locale=de vs. admin?locale=de.
This caused problems with the translatable module
reloading page content where it didn't need to,
because some previous robustness patches to the same problem
didn't apply (they only removed trailing slashes, ignoring
query parameter strings). The visible problem for this was
a broken tree panel, because it was ajax-loaded in parallel
with its container. Depending on ajax response order,
this would break the inner panel (in this case the tree),
since its original container was replaced with a new DOM.
Automatic tree node updating fails when for example creating a new
translation, due to the update URL containing two question marks,
due to the locale get parameter.
Fixed by using the $.path.addSearchParams utility function, which properly
checks for existing query string parameters.
- Updates icon, badges, title, and position in hierarchy
- New LeftAndMain_TreeNode API to allow rendering of single tree nodes
without their hierarchy, extracted from LeftAndMain->getSiteTreeFor()
- New LeftAndMain->updatetreenodes() endpoint to request updated state
for one or more nodes. Triggered on demand by form refreshes.
Guess the fragment based on the returned HTML.
The validation error HTTP response is generated by Form rather than
the controller (LeftAndMain), so we can't set custom PJAX headers easily.
Implemented independently of URL state to ensure that
state is retained on every user interaction, rather than
having to add it to each URL specifically.
Same reasons for not saving it as HTML5 history metadata,
as that's only inspected on history events, not
normal CMS navigation.
When one or more fragments are requested that are not in
the current DOM, we need to force loading the outermost
fragment instead (currently hardcoded to "Content").
This mainly prevents history back navigation from breaking,
e.g. admin/pages -> admin/pages/list ->
admin/pages/list/?ParentID=99 -> admin/pages/edit/show/5 -> (back)
Was using text/json, which Form->httpSubmission() interprets
(correctly) to returning JSON validation data.
This trips up the interface, which expects HTML with
the validation errors directly in the markup.
Broke when CMS URL already had query params,
such as ?locale=en_US with the Translatable module enabled.
With this patch it doesn't double-concat ?locale....
Still doubles query params, but that's acceptable
until we find a more solid URL manipulation lib for JS.