Posted: June 13, 2023 at 12:13 pm
Clear detail of issue we are experiencing here: https://www.loom.com/share/5838b743cb5145d683e2a049e3db82e6 We’ve had this site for a few years now. Recently the Event Espresso core plugin has caused woocommerce subscription products to break. Specifically, they are causing Subscription Products with LearnDash group registration to break. Though we have ‘show errors’ turned on, no error is given on the broken page. Turning EventEspress plugin off fixes the product issue. However, trying to turn the plugin fails with error: Where can I get older versions of EventEspresso core to test? And how the heck do I fix this issue? |
|
Hi there, So you mentioned you have ‘show_errors’ disabled and that no error is displayed, however when I navigate to the page in your video I can see this:
At the bottom of the page. That will only happen if a PHP fatal error is thrown and those are usually saved within your PHP error logs. If you open your servers PHP error log and search for ‘Fatal error’ around the same time match when you load the above page it should give you some details. Or, another option is to use this: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug That snippet goes within your site’s
What that will do is then store errors within So if you let me know when that has been added to the site I can retest and check for the error. I can send you a copy of 4.10.46 which should get the site working again within EE but we need the above error know what what is happening on the site to be able to troubleshoot further (otherwise your just stuck on that version). |
|
Yes please send me a copy of 4.10.46 For logs: Error is outputing on page now. Is the same: |
|
This reply has been marked as private. | |
It seems the error is an issue with the WPGraphQL plugin and its interaction with the EventEspresso plugin. Specifically, it appears that the filter_post_meta_for_previews() method in the WPGraphQL\Utils\Preview class is expecting a boolean or null value for the fourth argument ($single), but an array is being passed instead. To resolve this error, I modified the code for /public_html/wp-content/plugins/event-espresso-core-reg/vendor/wp-graphql/wp-graphql/src/Utils/Preview.php as follows: public static function filter_post_meta_for_previews($default_value, int $object_id, ?string $meta_key = null, $single = false) if (false === $resolve_revision_meta_from_parent) { $post = get_post($object_id); if (!$post instanceof \WP_Post) { if (‘revision’ === $post->post_type) { return isset($parent->ID) && absint($parent->ID) ? get_post_meta($parent->ID, $meta_key, (bool)$single) : $default_value; return $default_value; This isn’t ideal as the next updates will wipe it out. Also, further updates may have more conflicts with the changed code. Hopefully, this will help the EE developers come up with a fix. I purchased the ‘support ticket’, but not sure how to communicate directly with them. |
|
Also, downgrading back to 4.10.46 fixes the issue as well. |
|
Good to hear everything is fine now. If you need anything, feel free to reach us again. thanks |
|
Hi there, Although the error being thrown is indeed from the WPGraphQL plugin within Event Espresso, the problem here is not with that plugin itself. The method you’ve mentioned above is indeed setting a type declaration of null or bool on the 4th parameter passed to
Then it’s hooking that function into the WP core hook That hook is a dynamic hook ( https://developer.wordpress.org/reference/hooks/get_meta_type_metadata/ There is nothing within the WP core code itself to set those: https://github.com/WordPress/wordpress-develop/blob/6.2/src/wp-includes/meta.php#L633-L633 Notice how that filter is within So then The reason this doesn’t happen with 4.10.46 is v5+ introduced WPGraphQL, it was not used in v4 so then WPGraphQL wasn’t hooking into Do you have a local copy of the site in which you can open the whole site within an editor/ide and search for a call to These kinds of issues are going to come up more and more as plugins introduce stricter typing and proper type declarations. They are a good thing, but because PHP has been so lax with its typing for so long stuff like this happens. |
|
The support post ‘Event Espresso Core breaks Learndash subscription products’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.