WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

The theme directory "twentytwentyfour" does not exist. #232

Closed flexseth closed 2 months ago

flexseth commented 2 months ago

Error when booting in wp-content mode without a theme in the folder.

The theme directory "twentytwentyfour" does not exist. Error: The themes directory is either empty or does not exist. Please check your installation.

Why is this a problem

A theme is necessary to run any WordPress website. Let's make sure one is available.

Suggested fix

If no theme is in the wp-content/themes folder, install Twenty Twenty-Four

Step to install Twenty Twenty-Four (doesn't work but seems like it should)

{
    "step": "installTheme",
            "themeZipFile": {
                "resource": "wordpress.org/themes",
                "slug": "twentytwentyfour"
            },
            "options": {
                "activate": true
            }   
}

source: https://wordpress.github.io/wordpress-playground/blueprints-api/steps#InstallThemeStep**

Error code on attempted theme install - partially redacted

Starting the server...... directory:........./playground-docs-workflow/wp-content mode: wp-content php: 8.0 wp: 6.5.2 WordPress 6.5.2 folder already exists. Skipping download. SQLite folder already exists. Skipping download. blueprint steps: 3 Blueprint step completed: unzip Blueprint step completed: activatePlugin Error: Could not move /var/www/html/wp-content/ieU!7ZbrcT$JApjm3Z/5Z,wbT@NiKARm7ucg/assets/Twentytwentyfour/twentytwentyfour to /var/www/html/wp-content/themes/twentytwentyfour: There is no such file or directory OR the parent directory does not exist.

Affects

How to re-create the issue

blueprint.json

{
    "$schema": "https://playground.wordpress.net/blueprint-schema.json",
    "landingPage": "/wp-admin/edit.php?post_type=doc_page",
    "preferredVersions": {
        "wp": "6.4",
        "php": "7.4"
    },
    "features": { "networking": true }, 
    "login": true,
    "steps": [
        {
            "step": "unzip",
            "zipFile": {
                "resource": "url",
                "url": "https://github-proxy.com/partial/adamziel/playground-docs-workflow/wp-content"
            },
            "extractToPath": "/wordpress"
        },
        {
            "step": "activatePlugin",
            "pluginPath": "wp-docs-plugin/plugin.php"
        },
        {
            "step": "installTheme",
            "themeZipFile": {
                "resource": "wordpress.org/themes",
                "slug": "twentytwentyfour"
            },
            "options": {
                "activate": true
            }   
        }
    ]
}

I double checked the syntax on the blueprint with the {} and it's correct

networking is enabled - but possibly the culprit?

flexseth commented 2 months ago

Looks like it may be a URL or "resource type" issue

Screenshot 2024-04-12 at 9 56 43 PM Screenshot 2024-04-12 at 9 55 36 PM
sejas commented 2 months ago