• Resolved leifer

    (@leifer)


    On servers running PHP 8.2, when Create Block Theme -> Create Child Theme or Export Theme is run, it will try to zip the folder. It will do so using create-block-theme/admin/create-theme/cbt-zip-archive.php. However, this will prepend the following PHP warning to the front of the resulting zip file, which in turn, prevents said zip file from unzipping.

    “Deprecated: Creation of dynamic property CbtZipArchive::$theme_folder is deprecated in /var/www/html/wordpress/wp-content/plugins/create-block-theme/admin/create-theme/cbt-zip-archive.php on line 14

    I went to that file and found that line 14 was indeed creating a “dynamic property”. The fix is to… make that property not dynamic.

    I added “public string $theme_folder;” below “private string $theme_slug;” on line 9… and now it works as normal.

    This should be fixed in the main repo for Create Block Theme, but if anybody else runs into this problem you can either add the above to your cbt-zip-archive.php file, or after your zip is exported, if you open it in a text editor and remove the PHP warning from the front it should then unzip and be useable as normal.

    • This topic was modified 1 year, 4 months ago by leifer.
    • This topic was modified 1 year, 4 months ago by leifer.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP 8.2 Dynamic Property CbtZipArchive::$theme_folder is deprecated’ is closed to new replies.