Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
419 stars 57 forks source link

Conflict with tribe events calendar plugin #170

Closed eriteric closed 1 year ago

eriteric commented 1 year ago

My versions:

This is on a multisite - and the error happens only on subsites with sage themes. The main network site with the same theme and plugins does not produce the error for some reason, or I didn't wait long enough for it to show up.

This 500 error shows up when attempting to access either the Plugins page or the Events->Settings page of the tribe events calendar.

Error will go away if either:

I've narrowed this down to either/both acf-composer and tribe events, or it's just some weird incompatibility between them and wordpress subsites. It looks as if they conflict with how they are adding options/settings pages/menus.

I started fresh with 10.6.0 and slowly added in each file, and all seemed fine. But about 10 minutes later, then the error started showing up again.

Could this be an Acorn issue? I'm not sure if it's meant to work with multisite and multiple sage themes.

When trying to access wp-admin/plugins.php the stack trace from symfony is:

Error:
Cannot add element to the array as the next element is already occupied

  at /srv/www/mywebsite.com/current/web/wp/wp-admin/includes/plugin.php:1342
  at add_menu_page('The Events Calendar', 'The Events Calendar', 'manage_options', 'tec-events-settings', array(object(Freemius), '_connect_page_render'), 'dashicons-admin-generic', null)
     (/srv/www/mywebsite.com/current/web/app/plugins/the-events-calendar/common/vendor/freemius/includes/managers/class-fs-admin-menu-manager.php:864)
  at FS_Admin_Menu_Manager::add_page('The Events Calendar', 'The Events Calendar', 'manage_options', 'tec-events-settings', array(object(Freemius), '_connect_page_render'))
     (/srv/www/mywebsite.com/current/web/app/plugins/the-events-calendar/common/vendor/freemius/includes/class-freemius.php:18050)
  at Freemius->override_plugin_menu_with_activation()
     (/srv/www/mywebsite.com/current/web/app/plugins/the-events-calendar/common/vendor/freemius/includes/class-freemius.php:17959)
  at Freemius->add_menu_action()
     (/srv/www/mywebsite.com/current/web/app/plugins/the-events-calendar/common/vendor/freemius/includes/class-freemius.php:17939)
  at Freemius->_prepare_admin_menu('')
     (/srv/www/mywebsite.com/current/web/wp/wp-includes/class-wp-hook.php:308)
  at WP_Hook->apply_filters(null, array(''))
     (/srv/www/mywebsite.com/current/web/wp/wp-includes/class-wp-hook.php:332)
  at WP_Hook->do_action(array(''))
     (/srv/www/mywebsite.com/current/web/wp/wp-includes/plugin.php:517)
  at do_action('admin_menu', '')
     (/srv/www/mywebsite.com/current/web/wp/wp-admin/includes/menu.php:155)
  at require_once('/srv/www/mywebsite.com/current/web/wp/wp-admin/includes/menu.php')
     (/srv/www/mywebsite.com/current/web/wp/wp-admin/menu.php:420)
  at require('/srv/www/mywebsite.com/current/web/wp/wp-admin/menu.php')
     (/srv/www/mywebsite.com/current/web/wp/wp-admin/admin.php:158)
  at require_once('/srv/www/mywebsite.com/current/web/wp/wp-admin/admin.php')
     (/srv/www/mywebsite.com/current/web/wp/wp-admin/plugins.php:10)                
Log1x commented 1 year ago

This is highly unlikely to be directly related to ACF Composer or Acorn.

We do nothing that would prevent anything from simply adding an admin menu page (or any sort of functionality), and ACF Composer uses ACF's acf_add_options_page function for registering the option menus.

No fancy stuff happening that could cause issues. The only thing I can possibly thing of is #163 might make a difference if The Events Calendar is doing something ACF-specific, but I do not think so.

I'm going to close this issue, but I'd look into registering option pages using ACF's GUI and playing around with some other stuff to see if you can recreate the issue elsewhere.

The Events Calendar has some intense over-engineering going on when it comes to how they handle stuff. As you can see in your stack trace, they have 2 classes dedicated to wrapping native WordPress functionality into their own shenanigans. It's going to take some reverse-engineering and deep-diving to see what is exactly happening.

eriteric commented 1 year ago

Thanks for the response @Log1x . Yes, The events calendar is so bad - still has PHP8 issues I think. Yes GUI may be the fix for this, had the same thought but only after I sent this (sorry). Suppose I can do one, export the php, then add that to the theme in order to get it on all subsites. Hope you have a great day.