Issue with Multisite + Gutenberg

Yes, I’m sorry the two get a bit conflated here, but I did not want to flood with new topics. So, breaking down the two issues here, which are potentially related:

“Out of the box” using the install that I describe above, neither Gutenberg, nor the customizer work.

Gutenberg:

A temporary bandaid fix for Gutenberg is adding a 301 redirect for :

/wp/wp-admin/post.php* to /wp-admin/post.php*
/wp/wp-admin/post-new.php* to /wp-admin/post-new.php*

Customizer:

I tried the same style fix for customizer, i.e. adding a redirect for the Customizer

/wp/wp-admin/customize.php?return=%2Fwp%2Fwp-admin%2Fedit.php to /wp-admin/customize.php?return=%2Fwp%2Fwp-admin%2Fedit.php

I get the same results as if I do not redirect


In my trellis built server here is my .env

AUTH_KEY='{redacted}'
AUTH_SALT='{redacted}'
DB_HOST='localhost'
DB_NAME='manage_matgargano_com_production'
DB_PASSWORD='{redacted}'
DB_USER='{redacted}'
DISABLE_WP_CRON='True'
DOMAIN_CURRENT_SITE='manage.matgargano.com'
LOGGED_IN_KEY='{redacted}'
LOGGED_IN_SALT='{redacted}'
NONCE_KEY='{redacted}'
NONCE_SALT='{redacted}'
SECURE_AUTH_KEY='{redacted}'
SECURE_AUTH_SALT='{redacted}'
WP_ENV='production'
WP_HOME='https://manage.matgargano.com'
WP_SITEURL='https://manage.matgargano.com/wp'

You can recreate my issue using the repo I am using GitHub - matgargano/multisite

or I can easily give you access to everything, feel free to message me on slack and then whatever the solution is that we get to I will summarize for the rest of the community.

1 Like

any thoughts here? I may have to abandon MU for client sites if this is an issue. This would really neatly allow me to host multiple client sites on the same server.

There’s a 100% chance this can be fixed.

I currently don’t have the free time to look into this myself.

@mgargano I think I’m experiencing this issue as well. I’ll report back with my findings.

@knowler :+1: I am at a loss at this point.

The solution seems to be as simple as setting the following in config/application.php:

Config::define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);

For me the issues had to do with the nonce cookie not being able to verify since the sub-site domain was different than the cookie domain. I was having difficulty with Gutenberg and a multisite using custom domains for sub-sites. So I don’t know if this will work for your issue.

This does not work in my configuration.

Can you test if this works for your Customizer?

Also can you post your application.php

mine is: config.php · GitHub

Customizer seems to work fine. Here’s my Bedrock config:

https://gist.github.com/knowler/3727742a753cdd34750895c8303c259c

OK Few things —

First and foremost : https://gist.github.com/knowler/3727742a753cdd34750895c8303c259c#file-application-php-L102 any issue with the single colon? I’ve literally never seen that in PHP

Do you have all subdirectories? subdomains? Do you have any TLD mapped domains?

Thanks for the assistance so far…

Ok some more things…

If I use a subdomain, e.g. manage.matgargano.com and multisite.matgargano.com i am able to do everything without any issue.

if i map to a separate domain (foobar.com) that’s when i have the issue… still digging further…

My bad that’s a syntax error.

I have mapped domains with a subdomain setup.

Have you tried mapping TLDs and not subdomains? If not- can you? I can supply the domain if you need one.

Something isn’t adding up… likely something I’m doing. Would you want to walk through the whole process with trellis and bedrock with me to see where I’m possibly doing something wrong.

-Mat

@knowler any update here?

See this:

I can’t believe that was it !?

seems to work, need to do more testing

1 Like

OK, so I tried just wholesale replacing my application.php with your application.php

I still have the same issue

After Config::apply() I error_log out COOKIE_DOMAIN and it is in fact the right domain (the current domain I am on).

Any idea how to further troubleshoot?

one other thing to note is that wp_blogs has mydomain.com (the same domain set to COOKIE_DOMAIN above) and wp_3_options has siteurl = mydomain.com and home = mydomain.com/wp (i even tried changing home to = mydomain.com (without /wp) and still didnt work

@knowler where is the nonce check happening? I can troubleshoot backwards from there.

This topic was automatically closed after 42 days. New replies are no longer allowed.