8000 file_put_contents function does not report write/permissions error properly · Issue #770 · WordPress/create-block-theme · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
file_put_contents function does not report write/permissions error properly #770
Open
@catthetech

Description

@catthetech

When saving changes to a theme to which it does not have write permissions, the file_put_contents function will output an error in debug.log.
But the plugin will still say it succeeded in the editor. This leads to the destruction of user changes, without them being saved to the files

The error:

[24-Apr-2025 17:46:58 UTC] PHP Warning:  file_put_contents(/var/www/html/wp-content/themes/qip-wp-themes/merryclaude2025/theme.json): Failed to open stream: Permission denied in /var/www/html/wp-content/plugins/create-block-theme/includes/create-theme/theme-json.php on line 6

After fixing the permissions, the plugin saved perfectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0