mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 20:05:53 +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();
|
$file = $obj->file();
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$filename = substr($obj->name(), 0, -(strlen($obj->extension())));
|
$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 = File::instance($path);
|
||||||
$aFile->save();
|
$aFile->save();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user