When using the ajax framework, drupalSettings is updated (to update ajaxPageState mainly) but currently interferes with some values like currentPath
.
The patch removes a few variables from the settings that are sent back to the browser to avoid overriding them. If we get #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links somewhere we'll only need to remove the path
key from $settings
and that'll work.
This is a valid (didn't say pretty) patch because ajax requests won't change a page URL. If you're thinking of PJAX, well there will be a custom ajax command for that anyway and that custom command can mess with drupalSettings.currentPath
all it want. It's just that by default, path settings won't be updated.
Comment | File | Size | Author |
---|---|---|---|
core-ajax-currentPath-update.patch | 659 bytes | nod_ | |
Comments
Comment #1
Wim LeersHrm… this indeed solves the problem for now. But at the same time, it is indeed also a mind-bogglingly bizarre/weird/hacky solution to the problem.
I'm fine with this being committed as an intermediate solution, but only if a clear plan is laid out to solve this cleanly afterwards.
Comment #2
Wim LeersThis was apparently caused by #1691394: Drupal settings gets broken by AJAX requests, and at #27 of that issue, post-commit and post-backport-to-D7 sadly, it was noted that this really is introducing a critical bug.
Marking this issue as a duplicate.