mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Fix weird issue in the language code being added twice when saving a page in a new language
This commit is contained in:
@@ -1219,7 +1219,13 @@ class AdminController
|
||||
$file = $obj->file();
|
||||
if ($file) {
|
||||
$filename = substr($obj->name(), 0, -(strlen($obj->extension())));
|
||||
$path = $obj->path() . DS . $filename . '.' . $language .'.md';
|
||||
|
||||
if (substr($filename, -2) != $language) {
|
||||
$filename .= '.' . $language;
|
||||
}
|
||||
|
||||
$path = $obj->path() . DS . $filename . '.md';
|
||||
error_log($path);
|
||||
$aFile = File::instance($path);
|
||||
$aFile->save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user