mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-15 17:56:07 +01:00
Bugfix: Save in wrong lang when multiple tabs open (#1101)
* Bugfix: Save in wrong lang when multiple tabs open English and french in this PR are used only for example purposes. When you have multiple tabs opened in different languages, it often cause to ovewrite the french contents with the english contents (or vice-versa, or according to your specific language configuration). How to reproduce the bug : 1. Open a tab and edit a page in french 2. In another tab, open the same page in english then save 3. Return to the french tab and save 4. **The english contents got overwrited by the french contents** This patch makes the use of the language code in URL instead of the session when editing a page, preventing to overwrite the contents of another page while power-editing with many tabs in different languages. * Remove unused scopes about the session language
This commit is contained in:
committed by
Andy Miller
parent
d9c787681f
commit
424e8400f9
@@ -585,8 +585,8 @@ class AdminPlugin extends Plugin
|
||||
// Initialize Admin Language if needed
|
||||
/** @var Language $language */
|
||||
$language = $this->grav['language'];
|
||||
if ($language->enabled() && empty($this->grav['session']->admin_lang)) {
|
||||
$this->grav['session']->admin_lang = $language->getLanguage();
|
||||
if ($language->enabled()) {
|
||||
$this->grav['session']->admin_lang = $language->getActive();
|
||||
}
|
||||
|
||||
// Decide admin template and route.
|
||||
|
||||
Reference in New Issue
Block a user