diff --git a/source/content/guides/wordpress-composer/02-wordpress-composer-managed.md b/source/content/guides/wordpress-composer/02-wordpress-composer-managed.md index 408f82aabf..baae85548b 100644 --- a/source/content/guides/wordpress-composer/02-wordpress-composer-managed.md +++ b/source/content/guides/wordpress-composer/02-wordpress-composer-managed.md @@ -123,6 +123,20 @@ composer update vendor/package Replace `vendor/package` with the package name you want to update. This will update only the named package to the latest version that matches the version constraints in your `composer.json` file. +## Troubleshooting +### Restore overwritten `composer.json` +Sometimes, when a given upstream update includes changes to the `composer.json` file, it can conflict with your site's `composer.json` file. In these cases, applying the upstream update could result in the loss of content in your `composer.json` file. + +After applying such an update, check the commit log in the site dashboard. If you see many packages have been **removed**, you'll know the site's `composer.json` file has been overwritten by the upstream and needs to be resotred: + +![Pantheon update removing Composer packages](../../../images/wordpress-composer/02-wordpress-composer-json-removals.png) + +The easiest way to resolve this is to simply back up a copy of your current `composer.json` file locally before applying core updates. Then, apply the updates on Pantheon and `git pull` them into your local repository. From there, you can then restore the contents of `composer.json` based on your local back up of the file, run `composer update` and commit the changes. + +This may miss out on any actual updates to the `composer.json` in the upstream, so it's a good idea to check the [`composer.json` in the upstream repository](https://github.com/pantheon-upstreams/wordpress-composer-managed/blob/main/composer.json) to see if there are any changes you might want to incorporate into your own `composer.json` file. + +**Note:** If your site is using the Decoupled upstream for Front End Sites, the [`composer.json` is in the Decoupled WordPress (Composer Managed) upstream repository](https://github.com/pantheon-upstreams/decoupled-wordpress-composer-managed/blob/main/composer.json) + ## Report an Issue Create an [issue in the Github repo](https://github.com/pantheon-systems/wordpress-composer-managed/issues) for the team to review and address if you discover an issue with the WordPress Composer Managed upstream. diff --git a/source/images/wordpress-composer/02-wordpress-composer-json-removals.png b/source/images/wordpress-composer/02-wordpress-composer-json-removals.png new file mode 100644 index 0000000000..65c6dc27c3 Binary files /dev/null and b/source/images/wordpress-composer/02-wordpress-composer-json-removals.png differ