-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with zip file creation on Windows #602
Comments
Hi @nicholasingham, What is the WindowsOS version and CBT plugin version? I tested it on Windows 11, CBT plugin version 2.1.2, but could not reproduce it. |
Apologies. The problem is more obscure and difficult to reproduce than than I first realised. I've just done a fresh install of Wordpress 6.5.2 using LocalWP on Windows 10 and installed Create Block Theme plugin 2.1.2. I've then exported both the standard 2024 and 2023 themes using the CBT Export Zip option. I've now noticed that if I unzip the files using 7-Zip, I see the problem with odd files names that I described earlier. However, if I unzip the files using Windows built in "Extract All" feature in Windows Explorer, I do not see the oddly named files. I can also successfully import these exported zip files into another Windows LocalWP instance of Wordpress (and also to a site on a rather old version of XAMPP). However, if I try to install these theme files to a Wordpress instance on our cPanel Linux hosting running PHP8.1 I get the following error "The package could not be installed. Template is missing. Standalone themes need to have a templates/index.html or index.php template file. Child themes need to have a Template header in the style.css stylesheet." So it seems that the problem is only apparent using certain unzip programs e.g. 7-Zip and whatever PHP unzip library our cPanel hosting uses. Hope that makes sense. |
Thanks for the reply. I can reproduce the problem too and I think your suggestion makes sense. I believe #606 will fix this problem. |
When creating zip files on Windows, e.g. using LocalWP, the plugin creates files called
rather than
I'm not quite sure what the odd character is but it appears as a bold dot in Windows file explorer.
This only happens on Windows where DIRECTORY_SEPARATOR has been set to the backslash character
We've managed to create a workaround by changing the code on lines 175 and 198 in theme-zip.php from
and
to
and
The problem does not occur on a Linux host.
The text was updated successfully, but these errors were encountered: