Skip to content

file_put_contents function does not report write/permissions error properly #770

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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