![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
July 1, 2024 at 9:17 pm #1460846
Nach Installation der gerade veröffentlichten Enfold-Version 6.0 wird bei dem Versuch, den “Theme-Datei-Editor” zu starten,
folgender WordPress-Fehler angezeigt
“Diese Datei kann leider nicht bearbeitet werden.”Als unbefriedigende Zwischenlösung muss manuell in der Datei “../wp-includes/functions.php” die Zeile
“$file = wp_normalize_path( $file );”
entfernt oder auskommentiert werden.Dieser manuelle Eingriff sollte vermieden werden, d. h.
die Software des Enfold-Themes muss korrigiert werden, damit der Fehler nicht mehr auftritt!July 1, 2024 at 11:05 pm #1460862Hey OlafThomsen,
I can’t reproduce this problem on a test installation, could you tell us which steps you are taking for this to happen please?
Best regards,
RikardJuly 2, 2024 at 10:12 pm #1461118As I maintain two different websites, I usually test changes and new software versions in a “localhost environment” (currently Windows 11, XAMPP 8.2.12, WordPress 6.5.5) before installing them on the external servers.
The bad news:
In the “localhost environment”, the following test conditions always lead to the Theme Editor error:
– Uploading Enfold version 6.0 via WordPress -> Design -> Themes -> Add new theme -> enfold.zip
– Copy the folder “enfold” (version 6.0) directly into the directory “../wp-content/themes”.
– Using Firefox
– Using Chrome
– All plugins disabledThe good news:
After installing Enfold version 6.0 on the external servers, the error does not occur,
even though the file “../wp-includes/functions.php” on the external servers also contains the code
// Normalising the path for Windows servers
$file = wp_normalize_path( $file );
Note: This code was introduced with the current WordPress version 6.5.5!July 3, 2024 at 7:19 am #1461161Hi,
Thank you for the info.
We can’t reproduce the same issue on our local installation. This might be something unique to your local setup. Have you tried using a different local server?
Best regards,
IsmaelJuly 3, 2024 at 6:23 pm #1461240I did some further investigation and found that in “theme-editor.php” the absolute path of “$file” contains backslashes,
for example
“D:\xampp\htdocs\website-name/wp-content/themes/enfold-child/style.css”.
The backslashes cause the error reported by
“$file = wp_normalize_path( $file );”.
Replacing the backslashes by normal slashes in “theme-editor.php” like this
“$allowed_files[‘style.css’] = str_replace(‘\\’, ‘/’, $style_files[‘style.css’]);”
can avoid the error.
Manual patching is unsatisfactory, but I did not find any other solution to the problem.
Note:
Surprisingly, the plugin-file-editor does not have this problem, because only relative paths are used, not absolute ones.
May be the (WordPress-/)Theme developers could take a look at this and adopt that solution. -
AuthorPosts
- You must be logged in to reply to this topic.