Mailchimp feed "Map Fields" coming up empty

I have a client site where I can’t set up a Mailchimp feed because after selecting the audience, nothing shows up under the Map Fields heading.

This seems to be related to a trio of JavaScript errors that are appearing on the page:

TypeError: undefined is not an object (evaluating ‘new gform.components.dropdown’)
ReferenceError: Can’t find variable: initializeFieldMap
ReferenceError: Can’t find variable: FeedConditionObj

I’ve tested for theme conflicts on a sandbox site, and for plugin conflicts as best as I can on the live site (I can’t deactivate certain plugins), and I’m unable to replicate the issue.

I’m wondering if it’s an incomplete setup on the client’s Mailchimp account (I don’t have access to it, so my testing is using my own Mailchimp account), or if there’s some kind of file permissions issue on the client’s server (they’re hosted at Flywheel, but my sandbox site is on my own VPS).

One thing I did notice is that the inline JavaScript Gravity Forms is inserting into the page is significantly different between the live site and my sandbox site, even though both are running the same versions of everything: WP 6.0.1, GF 2.6.5, and GF Mailchimp Add-on 5.1.

OK, I’ve been able to track down the issue to the fact that GF Mailchimp Add-on is choking on trying to load my theme’s custom Block Patterns on the AJAX call to populate the Map Fields area of this screen.

My workaround for now is to insert a conditional into my function that contains all of my register_block_pattern() calls, to prevent it from running if I’m on a GF editing screen:

if (is_admin() && !empty($_GET['page']) && $_GET['page'] == 'gf_edit_forms') { return; }

This is… not great. Perhaps there’s a better hook than init to use for registering Block Patterns, even though that’s what’s in the WP docs. It seems more to me that this is a fundamental flaw in the way the Block Editor/Block Patterns are constructed. (Then again there are many of those.)

Still… this code simply should not be loading on the GF AJAX call here. Is there a better way for me to avoid it?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.