Home › Forums › Bug Reports › Bug: ACF Pro 5.2.3 and WP Multisite › Reply To: Bug: ACF Pro 5.2.3 and WP Multisite
Upgrading to ACF Pro 5.2.3 is also causing Multisite issues for our installation (WP 4.2.1). We’re not using the Domain Mapping plugin, and the problem isn’t manifesting itself as a redirect loop, but it seems like this might be related to the above issue reports.
What I’m seeing is that WordPress’s PATH_CURRENT_SITE constant is incorrect when 5.2.3 is activated. The problem is very visible when looking at the Multisite “Network Setup” page (/wp-admin/network/setup.php) — for reasons unclear, PATH_CURRENT_SITE is listed there as the path to one of our child sites, not the actual top-level site path (e.g. it’s set to ‘/child-site/’ when it should just be ‘/’ as set in wp-config.php). Deactivating ACF Pro corrects this issue.
The wrong PATH_CURRENT_SITE seems to be wigging out things elsewhere in the WordPress admin dashboard, causing some of our other plugins to break (like WP Migrate DB Pro), where that plugin gets confused about why we’re running a Network-level plugin on a child site.
As a shot in the dark, I’d suspect that maybe the issue is in the change to ACF’s /admin/update.php, with the new acf_admin_update->network_admin_menu() method. It’s using restore_current_blog(), which I think actually just bounces WP back to the “previous” blog in the stack, not the “original” blog? Or in any case, the normal recommendation is to run it after every switch_to_blog() according to the docs: https://codex.wordpress.org/Function_Reference/restore_current_blog
In our case, the PATH_CURRENT_SITE is set to our next-to-last (based on site ID) child site’s path, so that seems to back up the restore_current_blog() theory…? Maybe.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.