Coder Social home page Coder Social logo

Comments (3)

oxyc avatar oxyc commented on July 17, 2024 6

A quickfix I used was changing it to:

foreach (['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'] as $hook) {
    add_filter($hook, function ($path) {
        if (is_file($path)) {
            return $path;
        }
        return dirname($path);
    });
}

from sage.

ligne13 avatar ligne13 commented on July 17, 2024 3

@oxyc Thanks ! I also had to create a dummy theme.json file inside the resources directory with just an empty object:

resources/theme.json

{}

from sage.

figureone avatar figureone commented on July 17, 2024

We are seeing this also on WordPress 6.3 and narrowed it down to a check for theme.json here:
https://github.com/WordPress/wordpress-develop/blob/6.3/src/wp-includes/class-wp-theme-json-resolver.php#L242-L243
Since theme_file_path discards the filename, but is_readable() still is true because the directory is readable, we end up with the error.

Full stack trace for us:

#00 /wp-includes/class-wp-theme-json-resolver.php(110): wp_json_file_decode('/wp-content/themes/sage/resources', ['associative' => true])
#01 /wp-includes/class-wp-theme-json-resolver.php(244): read_json_file('/wp-content/themes/sage/resources')
#02 /wp-includes/class-wp-theme-json-resolver.php(591): get_theme_data()
#03 /wp-includes/global-styles-and-settings.php(80): get_merged_data('theme')
#04 /wp-includes/block-supports/typography.php(500): wp_get_global_settings()
#05 /wp-includes/class-wp-theme-json.php(1696): wp_get_typography_font_size_value(...)
#06 /wp-includes/class-wp-theme-json.php(1773): get_settings_values_by_slug(...)
#07 /wp-includes/class-wp-theme-json.php(1516): compute_preset_vars(...)
#08 /wp-includes/class-wp-theme-json.php(1072): get_css_variables(...)
#09 /wp-includes/global-styles-and-settings.php(206): get_stylesheet(...)
#10 /wp-includes/script-loader.php(2467): wp_get_global_stylesheet()
#11 /wp-includes/class-wp-hook.php(310): wp_enqueue_global_styles('')
#12 /wp-includes/class-wp-hook.php(334): apply_filters(NULL, [0 => ''])
#13 /wp-includes/plugin.php(517): do_action([0 => ''])
#14 /wp-includes/script-loader.php(2225): do_action('wp_enqueue_scripts')
#15 /wp-includes/class-wp-hook.php(310): wp_enqueue_scripts('')
#16 /wp-includes/class-wp-hook.php(334): apply_filters(NULL, [0 => ''])
#17 /wp-includes/plugin.php(517): do_action([0 => ''])
#18 /wp-content/themes/sage/app/filters.php(96): do_action('wp_head')
#19 /wp-content/themes/sage/vendor/illuminate/collections/Traits/EnumeratesValues.php(245): App\{closure}('wp_head', 1)
#20 /wp-content/themes/sage/app/filters.php(102): each(Closure::__set_state(array()))
#21 /wp-includes/class-wp-hook.php(310): App\{closure}('/wp-content/themes/sage/resources/views/single-work.blade.php')
#22 /wp-includes/plugin.php(205): apply_filters('/wp-content/themes/sage/resources/views/single-work.blade.php', array(0 => '/wp-content/themes/sage/resources/views/single-work.blade.php',))
#23 /wp-includes/template-loader.php(104): apply_filters('template_include', '/wp-content/themes/sage/resources/views/single-work.blade.php')
#24 /wp-blog-header.php(19): require_once('/wp-includes/template-loader.php')
#25 /index.php(17): require('/wp-blog-header.php')

from sage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.