WordPress 4.7 update moved all widgets

Not sure if this trellis/bedrock/sage but I have seen this problem before. After updating to WP 4.7, all my widgets are moved to “Inactive Sidebar” sections. So for every registered sidebar, all widgets are gone and are placed in sections at the bottom labelled “Inactive Sidebar (not used)”.

Has anyone else experienced this? My only real departure from the usual Roots way of doing things is that my theme is a dependency of my site.

Started digging into wp_options. Discovered the following:

Before 4.7 update:

97	sidebars_widgets	a:3:{s:19:"wp_inactive_widgets";a:0:{}s:15:"sidebar-primary";a:11:{i:0;s:18:"unresolved-posts-2";i:1;s:13:"quick-links-2";i:2;s:10:"nav_menu-7";i:3;s:10:"nav_menu-2";i:4;s:10:"nav_menu-3";i:5;s:10:"nav_menu-4";i:6;s:10:"nav_menu-5";i:7;s:10:"nav_menu-6";i:8;s:14:"recent-posts-2";i:9;s:17:"recent-comments-3";i:10;s:10:"archives-2";}s:13:"array_version";i:3;}	yes

After 4.7 update:

97	sidebars_widgets	a:3:{s:19:"wp_inactive_widgets";a:2:{i:0;s:13:"quick-links-2";i:1;s:18:"unresolved-posts-2";}s:18:"orphaned_widgets_1";a:9:{i:0;s:10:"nav_menu-7";i:1;s:10:"nav_menu-2";i:2;s:10:"nav_menu-3";i:3;s:10:"nav_menu-4";i:4;s:10:"nav_menu-5";i:5;s:10:"nav_menu-6";i:6;s:14:"recent-posts-2";i:7;s:17:"recent-comments-3";i:8;s:10:"archives-2";}s:13:"array_version";i:3;}	yes

… still digging. Think this is related to trellis and possibly this “Update WP theme paths” deploy hook. I’m going to try and deploy again with this hook removed.

… update: after commenting out the following deploy hook, the problem is resolved. Now my question is, what are the possible side-effects of commenting out this hook? What is it’s original intended purpose?

- name: Update WP theme paths
  command: wp eval 'wp_clean_themes_cache(); switch_theme(get_stylesheet());'
    chdir: "{{ deploy_helper.new_release_path }}"
  when: wp_installed | success

I am facing this problem as well. After each deploy all my widgets are moved to inactive. I might going to comment out the deploy hook. Thanks for sharing this.

Dropping a link to your other thread since it’s basically the same as this…

Curious if y’all are running a typical Trellis setup with 1 WordPress site, or do you have multiple WordPress sites defined?

Thanks I meant to come back and drop that link here.

I am running multiple sites in my trellis environment. Each site is forked from Bedrock and contains a theme forked from Sage. I was always under the impression Trellis was setup as an environment for developing and deploying multiple sites. I have been using it in the capacity for quite a while now and it is great.

I’m just trying to determine if anyone has seen this happen outside of a Trellis install that has multiple sites.

Trellis is setup for developing and deploying multiple sites. That said, I have consistently experienced this bug on one occasion — a install that has 3 different WP sites defined. It only happened on deploying 1 out of the 3 and I didn’t have the time to dig into it.

@timmen22 does your install also have multiple sites?

Gotcha. So ya 5 sites across 2 servers. I know it happened on multiple sites, but cannot remember if it was all 5.

I’ve updated the deploy hook with a better method which should fix these problems: https://github.com/roots/trellis/pull/720