-
Notifications
You must be signed in to change notification settings - Fork 269
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
Error when blueprint includes themeInstall
step for latest WordPress default theme
#1157
Comments
Good point @ndiego! I think the step should still execute because the theme might have a newer version than the bundled one. Removing the bundled theme and logging a console.warning could be a good solution. In the meantime, you could use this as a workaround: {
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"features": {
"networking": true
},
"steps": [
{
"step": "login"
},
{
"step": "rmdir",
"path": "/wordpress/wp-content/themes/twentytwentyfour"
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "wordpress.org/themes",
"slug": "twentytwentyfour"
}
}
]
} |
Yeah great point! |
…steps (#1244) Adds an `ifAlreadyInstalled?: 'overwrite' | 'skip' | 'error'` option to installPlugin and installTheme steps. It defaults to `overwrite`. Consider the following Blueprint: ```json { "preferredVersions": { "php": "latest", "wp": "6.4" }, "steps": [ { "step": "installTheme", "themeZipFile": { "resource": "wordpress.org/themes", "slug": "twentytwentyfour" } } ] } ``` Before this PR, it would result in an error. After this PR, the installation just works. If the Blueprint author explicitly wants the installation to fail, they can specify the `ifAlreadyInstalled` option: ```json { "steps": [ { "step": "installTheme", "themeZipFile": { "resource": "wordpress.org/themes", "slug": "twentytwentyfour" }, "ifAlreadyInstalled": "skip" // or "error" } ] } ``` ## Motivation Installing a plugin or theme over a currently installed one is a common gotcha. Currently it results in an error and blocks the Blueprint execution. This behavior is, however, often undesirable as it prevents having a single Blueprint that installs a twentytwentyfour theme on different versions of WordPress. An addition of the `ifAlreadyInstalled` option puts the Blueprint author in control and provides a sensible default behavior where the installation will "just work" by replacing the already installed version of the plugin or theme. Closes #1157 Related to WordPress/blueprints#19 ## Testing instructions Confirm the unit tests pass cc @bgrgicak @brandonpayton
If your blueprint includes a step for
themeInstall
that includes the latest WordPress theme, which is currently TT4, you get an error because the theme is already installed. Also, if there are steps following thethemeInstall
step, they won't get triggered due to the error.Here's an example blueprint.
And here's the resulting error.
Perhaps if there's a step that installs a theme or plugin that already exists by default in Playground, the step is ignored.
The text was updated successfully, but these errors were encountered: