Closed ChexWarrior closed 6 years ago
I actually found a better solution to this issue over at the wordpress installer repo: https://github.com/johnpbloch/wordpress/issues/8#issuecomment-105761442
Instead of installing my plugins and themes in the web folder I install them in a directory outside of wordpress core and then in a post-install-cmd I copy the contents to the expected place within the web directory.
Hi,
I have been attempting to update my WordPress sites on Wodby from 4.9.5 to 4.9.6, however each time I do this all of the packages (that is plugins) installed by composer are removed. I believe the reason this is occurring is that I've set my plugins to install within the
web/wp-content/plugins
directory which is within the WordPress core installation pathweb
. When composer updates it sees that my plugins are up to date and then updates core which removes everything in theweb
directory and replaces it with the updated files, however this does not include the packages that were previously installed.I have a workaround which is to add the entire
web/wp-content/plugins
directory into thepreserve-paths
array, however this means that whatever was originally in that directory will overwrite whatever was added by a core update. So far I haven't noticed any ill effects, however I'm going to keep testing to make sure of this.To reproduce this issue you need the lock file generated by the 4.9.5 core update and the 4.9.6 core update. Initially run a clean install of WordPress 4.9.5, after this completes update the WordPress core package (
johnpbloch/wordpress-core
) to point to 4.9.6 and then replace the current composer.lock with the lock file created by 4.9.6. The reason for this is that I update my lock file locally and push this to my staging and prod environments so acomposer update
command is never run anywhere except on my own dev machine. Run a composer install again and you will see that any packages installed by composer will be missing.My composer.json is as follows: