Hi!
I have couple of WordPress pages with Sage 9 theme and after last WP update to 6.3 i have warnings:
**Warning** : file_get_contents(C:/wordpress/sitefolder/app/public/wp-content/themes/themename/resources): Failed to open stream: Permission denied in **C:\wordpress\sitefolder\app\public\wp-includes\functions.php** on line **4570**
Anyone have this warnings? I searched for answers but no luck yet.
This seems like a permissions error. Have you tried resetting file permissions on the server? sometimes they can get changed when a new update comes out.
Hi, we also get the following messages on our sites with Sage 9, Sage 10 works without problems.
**Notice** : file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in**/srv/www/.../current/web/wp/wp-includes/functions.php** on line**4570**
**Notice** : Fehler beim Dekodieren einer JSON-Datei unter /srv/www/.../current/web/app/themes/...-theme/resources: Syntax error in**/srv/www/.../current/web/wp/wp-includes/functions.php** on line**4578**
**Notice** : file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in**/srv/www/.../current/web/wp/wp-includes/functions.php** on line**4570**
**Notice** : Fehler beim Dekodieren einer JSON-Datei unter /srv/www/.../current/web/app/themes/...-theme/resources: Syntax error in**/srv/www/.../current/web/wp/wp-includes/functions.php** on line**4578**
It doesn’t say anything about permissions, but it could be the same source of the problem.
I think that the theme.json is needed, which does not exist in Sage 9. But simply creating one did not work.
If you put a theme.json in /themes/themename/resources, nothing happens. You get back an empty array. But if you change $theme_json_file = $wp_theme->get_file_path( 'theme.json' ); to $theme_json_file = '/srv/www/.../current/web/app/themes/...-theme/resources/theme.json'; the warnings are gone .
Thank you for pointing me in the right direction! Using the filter in get_file_path, we can manually override the function’s return value to tell WP we don’t have a theme.json file. Adding this in filters.php did the trick for me:
The proposed solution doesn’t work for themes WITH a theme.json file. This is an alternative solution that works in both cases (replace in functions.php):