platformsh-templates / wordpress-composer

Wordpress (Composer)
14 stars 10 forks source link

wp-content/wp-content folder #7

Open danharper83 opened 3 years ago

danharper83 commented 3 years ago

I used this template to create a site as a demo and it worked fine until I added a plugin using composer, after dpeloying the changes I ended up with the following folder structure.

wordpress/wp-content/wp-content/plugins (seems to have akismet antispam) wordpress/wp-content/wp-content/themes (Has the default wordpress themes which are not available in the UI)

wordpress/wp-content/plugins wordpress/wp-content/themes

the default wordpress themes don't load in the UI

trolologuy commented 3 years ago

Steps to reproduce:

  1. Create a new project using the template
  2. Clone the project locally: platform get <projectid> -e master
  3. Add a theme and a plugin composer require wpackagist-plugins/dolphy as theme and composer require cruzer/dolphin (took two random themes / plugins) composer update, composer upgrade, git add composer.json composer.lock, git commit -m "adding random theme and plugin" and git push
  4. run platform ssh -p <projectid> "ls -la wordpress/wp-content/"

And you will get the following:

total 8
drwxr-xr-x 7 web web  114 Feb 22 14:30 .
drwxr-xr-x 5 web web  494 Feb 22 14:30 ..
drwxr-xr-x 2 web web 4096 Feb 22 13:44 cache
drwxr-xr-x 2 web web   33 Feb 22 14:30 plugins
drwxr-xr-x 3 web web   32 Feb 22 14:30 themes
drwxr-xr-x 3 web web 4096 Feb 22 13:45 uploads
drwxr-xr-x 4 web web   73 Dec  8 22:34 wp-content

wp-content is double-nested.

chadwcarlson commented 3 years ago

@danharper83 Thanks for letting us know about this. From what I could tell (linked in https://github.com/platformsh/template-builder/pull/410) this has to do with WordPress installing/copying-over file paths conflicting with Composer, and its best to just require those default themes and plugins to begin with.

See https://github.com/platformsh-templates/wordpress-composer/pull/8 for the changes.

Thanks again!

cc @trolologuy