• Resolved wtzrsupport

    (@wtzrsupport)


    Hi Guys,

    Running on PHP PHP 8.2.6 im running in to this error when i try to generate a “Create Child of Freshcart(my blocked theme)”

    Is there a certain library or package i’m missing that needs to be installed on my server to make this work?


    [28-Jun-2023 08:33:40 UTC] PHP Fatal error:  Uncaught Error: Call to undefined method WP_Error::addThemeDir() in /var/www/xxx/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php:103
    Stack trace:
    #0 /var/www/xxx/wp-content/plugins/create-block-theme/admin/class-create-theme.php(257): Theme_Zip::add_templates_to_zip()
    #1 /var/www/xxx/wp-content/plugins/create-block-theme/admin/class-create-theme.php(461): Create_Block_Theme_Admin->create_child_theme()
    #2 /var/www/xxx/wp-includes/class-wp-hook.php(308): Create_Block_Theme_Admin->blockbase_save_theme()
    #3 /var/www/xxx/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #4 /var/www/xxx/wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 /var/www/xxxx/wp-admin/admin.php(175): do_action()
    #6 /var/www/xxx/wp-admin/themes.php(10): require_once('...')
    #7 {main}
      thrown in /var/www/xxx/wp-content/plugins/create-block-theme/admin/create-theme/theme-zip.php on line 103
    • This topic was modified 2 years, 11 months ago by wtzrsupport.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wtzrsupport

    (@wtzrsupport)

    For anyone stumbling upon this, getting a fatal error when you try to create a child theme.

    This is a compatibility issue with PHP 8.2.6 (possibly also php 8.2 and up)

    I’ve downgraded to PHP 8.1. It now works. For developers, you may want to check this, since it’s currently not compatible with the latest PHP versions.

    Moderator jordesign

    (@jordesign)

    Hey @wtzrsupport – thanks for digging into that and sharing the solution. Just to confirm what you’re saying from your test – you found it worked when running on PHP 8.1 – but not when using PHP 8.2.x ?

    Moderator jordesign

    (@jordesign)

    Interestingly – I found I was able to export a child theme when running PHP 8.2 – so there may be something more going on there.

    What I’d recommend is that you make a bug report to the Github repository for the plugin – and the devs will be able to take a closer look.

    https://github.com/WordPress/create-block-theme/issues

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Call to undefined method WP_Error::addThemeDir()’ is closed to new replies.