Skip to content
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

Update WP theme paths only when template_root in releases_path #840

Merged
merged 1 commit into from
Jun 15, 2017

Conversation

fullyint
Copy link
Contributor

@fullyint fullyint commented Jun 15, 2017

The update to WP theme paths is needed only if the WP template_root falls in the releases subdirectory. The problem to solve — originally addressed by #275 then 632bbe8 — is that on deploy, the template_root will sometimes retain the old releases path value, such as /srv/www/example.com/releases/20170614235048/web/wp/wp-content/themes, when in fact it needs to be assigned the new release path, such as /srv/www/example.com/releases/20170614235217 (the newer date).

This PR uses a safer condition in evaluating whether to update the theme paths. It performs the update only if the releases_path (/srv/www/example.com/releases) appears in the retrieved template_root value. This revised condition avoids overwriting less common template_root values such as subdirectories of plugins. Such paths were not accounted for prior to this PR and would have been reset inappropriately, unintentionally deactivating such themes.

The update is needed only to fix the release subdirectory,
so it is safest to condition the update upon the releases_path
being in the template_root. This avoids overwriting less common
template_root values such as subdirectories of plugins, etc.
@swalkinshaw
Copy link
Member

Makes sense 👍

@fullyint fullyint merged commit 049d269 into master Jun 15, 2017
@fullyint fullyint deleted the wp-theme-paths branch June 15, 2017 04:54
primozcigler added a commit to primozcigler/trellis that referenced this pull request Jun 26, 2017
* master: (120 commits)
  Reload Nginx with updates to manual cert or key (roots#843)
  Add self signed certificates subdomains (roots#812)
  Add support for SMTP without authentication
  Remove output about running WP-CLI and Composer
  Option to install WP-CLI packages (roots#837)
  Update WP theme paths only when template_root in releases_path (roots#840)
  Update wp-cli to 1.2.1 (roots#838)
  skip plugins with WP-CLI, to avoid crappy plugins breaking deploys
  Add options for sources and version
  Add re-run vagrant up message
  Remove plugins from README
  Auto-install Vagrant plugins
  Fixes
  Add Vagrant config support
  Use python slice on password salt instead of Jinja2 truncate()
  Avoid single var containing jinja delimiters in when parameter
  Remove jinja delimiters from tasks' when parameter
  Update connection test for new dense.py callback in Ansible 2.3
  Deploys: Make wp core update-db optional (roots#827)
  Use a block
  ...

# Conflicts:
#	Vagrantfile
#	ansible.cfg
skemantix pushed a commit to skemantix/trellis that referenced this pull request Sep 4, 2017
…#840)

The update is needed only to fix the release subdirectory,
so it is safest to condition the update upon the releases_path
being in the template_root. This avoids overwriting less common
template_root values such as subdirectories of plugins, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants