When adding link to internal page from Inline version of CKEditor, then "Browse Mode", "Content Mode" and "Design Mode" buttons in top frame start to point to the internal page in the link instead of currently edited page:
This happens because:
- AJAX request for getting website internal pages contains "?admin=1", which results in each internal page link having that "?admin=1" in it as well
- in attempt to get anchors on the page the CKEditor trying to load that page in iframe, which due "?admin=1" presence thinks, that we're editing that page and putting it's "Browse Mode", "Content Mode", "Design Mode" buttons in top frame instead
- the "last_template" in session is set to page for which anchors were queried and overwrites actually edited page
- when loading list of internal pages don't pass "?admin=1"
- when querying page anchors add "?skip_last_template=1" to avoid overwriting "last_template" in session