Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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!

    #1460862

    Hey 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,
    Rikard

    #1461118

    As 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 disabled

    The 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!

    #1461161

    Hi,

    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,
    Ismael

    #1461240

    I 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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.