• I’m trying to display this field through BuddyForms in the front-end of my site, however select2 is not initialised, and the list of icons is empty.

    Any ideas of what could be happening?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    I am not familiar with BuddyForms so I can’t speak directly to that portion of your question.

    This plugin piggybacks on the select2 that is loaded from ACF itself. So one option might be to load acf_form_head on your frontend as well. If loading ACF’s form head is not an option for you, you may be able to enqueue Select2 yourself to get around this issue.

    Thread Starter jesusinica

    (@jesusinica)

    Thanks for your respone, Matt, I’ve tried including acf_form_head() but still doesn’t work… There is something funny about my setup I guess.

    I’m also using acf country selector and a few other add-ons and yours is the only one presenting the issue, would be interesting to know what is causing it…

    If you have the availability to have a look, this is the page where I’m getting the issue: https://staging8.portfolio-collective.com/collective/the-collective-network/%5BUSERNAME%5D/profile/edit/group/8/

    You’ll need to sign-up here: https://staging8.portfolio-collective.com/signup/

    • This reply was modified 4 years, 2 months ago by jesusinica.
    Plugin Author Matt Keys

    (@mattkeys)

    When someone is logged into this member area, are they also logged into WordPress?

    The ajax call that retrieves the icons for the select2 field assumes a logged in WordPress user (the wp_ajax_ call). There could potentially be another call added for unauthenticated users (the wp_ajax_nopriv_ call). I would have to think about any potential side effects/ramifications of the change.

    A quick test would be: does this field work for you if you are logged in to your WordPress admin account?

    The potential fix to this would be adding this line:

    add_action( 'wp_ajax_nopriv_acf/fields/font-awesome/query', array( $this, 'select2_ajax_request' ) );

    right underneath line #65 in /assets/inc/class-ACFFA-Loader-5.php. Or under line #42 in /assets/inc/class-ACFFA-Loader-4.php if you are on FontAwesome 4.

    Thread Starter jesusinica

    (@jesusinica)

    Yes, if someone is logged into the member area they’re also logged into wordpress (it’s using buddypress behind the scenes).

    I’ve tried adding the line you suggest just after line #65 (ACFFA_refresh_latest_icons), but it still doesn’t render.

    I’ve made you admin in case you want to check the admin side.

    Plugin Author Matt Keys

    (@mattkeys)

    Looking at your developer tools ‘network’ tab, when you click the fontawesome icon field, you should see a call out to admin-ajax.php where it tries to get the icons. I am not seeing that call happening on your site.

    I’ve done some testing locally using an ACF front end form. That test worked so I know the field *can* work on the front end.

    I am unsure why it isn’t working in your case. You could try a test using that same acf_form() function to see if it tells you anything about the problem.

    This could be a conflict with another plugin, if you are able to do some trial/error disabling other plugins you may be able to narrow down where the issue is, if it is a conflict.

    Thread Starter jesusinica

    (@jesusinica)

    Yep, I’m pretty sure it’s a conflict with BuddyForms, what is driving me mad is that I can’t see what’s the exact conflict. Similarly as you, I was checking for calls failing or console erros, but everything seems normal except for the fact that the field is not rendering.

    Btw, just saw your website and found that you’re a freelance, we’re hiring, in case you’re interested ??

    Plugin Author Matt Keys

    (@mattkeys)

    Ha, thanks for the offer. Currently have more work that I can keep up with!

    Let me know what you find in plugin conflict debug testing.

    Hi @jesusinica ‘M one of the developers of BuddyForms. Please contact [email protected] and we will try to make it work for you.

    Plugin Author Matt Keys

    (@mattkeys)

    Thanks Sven,

    If there ends up being something helpful to know for others experiencing this issue, please share your findings here!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Select2 not being initialised’ is closed to new replies.