Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In admin select field selected choice displays as html #48

Open
dbrabyn opened this issue Jul 16, 2021 · 16 comments
Open

In admin select field selected choice displays as html #48

dbrabyn opened this issue Jul 16, 2021 · 16 comments

Comments

@dbrabyn
Copy link

dbrabyn commented Jul 16, 2021

Details

  • WordPress version: 5.7.2
  • ACF version: Pro 5.9.8
  • For UX/UI issues: MacOS, Safari v 14.1.1 and Chrome v 91.0.4472.114 (Official Build) (x86_64)
  • Allow null: true
  • Multiple values: false
  • Stylised UI: true
  • Condtional logic: false

Reproduction

Bug summary

In the admin the dropdown list displays the flag icons and country names correctly but the select field shows the following html for the flag icon and country name (in this case South Africa).
<span class="acf-country-flag-icon famfamfam-flags za"></span> <span class="acf-country-flag-name">Afrique du Sud</span>

Steps to reproduce

Regular WP install on local and production sites.

Actual result

See screen grab:
CleanShot 2021-07-16 at 18 19 23@2x

Expected result

In the admin the select field should display the flag icon and country name -- as it does for the dropdown list .

@nlemoine
Copy link
Owner

Hello @dbrabyn

I'm not able to reproduce your bug. Do you have other plugins activated on your site? Maybe another plugin is loading a different version of select2. Try deactivating other plugins.

@stirrell
Copy link

I was just having the same issue. In my case, the culprit was WooCommerce. Toggling WooCommerce causes this issue to go away/come back.

@dbrabyn
Copy link
Author

dbrabyn commented Jul 21, 2021

Yep, WooCommerce is loading plugins/woocommerce/assets/js/select2/select2.full.min.js?ver=4.0.3 which is really selectWoo, "a fork of select2 with improved accessibility".

@zuperuser
Copy link

Having the same issue.
WPML is loading select2 too (and I can't de-activate this plugin...).
How can we solve this problem?

@nlemoine
Copy link
Owner

https://www.advancedcustomfields.com/blog/acf-5-10-release-html-escaping-blocks-api-v2-block-preloading-and-more/

A new version of ACF has been released:

Update: We’ve also pushed out version 5.10.1, which includes a fix for a conflict with WooCommerce’s SelectWoo library.

Can you tell if that fixes the issue?

@dbrabyn
Copy link
Author

dbrabyn commented Aug 28, 2021

I'm still seeing it with ACF Pro 5.10.1.

@zuperuser
Copy link

Same here; still HTML in the dropdowns...

@lgladdy
Copy link

lgladdy commented Sep 1, 2021

Hey everyone,

This should be resolved in ACF 5.10.2, but please let me know if not!

It seems to be working okay for me now. Try clearing your browser caches if you still have issues.

Screenshot 2021-09-01 at 13 51 20

@dbrabyn
Copy link
Author

dbrabyn commented Sep 1, 2021

Still there for me.

@nlemoine
Copy link
Owner

nlemoine commented Sep 1, 2021

Hi ACF-country users,

I'm thinking about removing flags images in favor of emoji flags: lighter, removing a dependency, no more select2 issues, etc.

What do you think about it?

@zuperuser
Copy link

zuperuser commented Sep 1, 2021

ACF 5.10.2 solved it for me.
BTW: emoji flags are a good idea!

@hercilioseox
Copy link

Hey there. Just found the same issue.
ACF: 5.11.4
WooCommerce: 6.1.1
ACF Country: 2.0.2

The emoji flags idea looks great. Please let us know when we can test it.

@nlemoine
Copy link
Owner

nlemoine commented May 5, 2022

Looks like emoji flags are dead 😢

https://blog.unicode.org/2022/03/the-past-and-future-of-flag-emoji.html

That's a shame and a bad coincidence, a few after days after I almost finished writing a new version with emoji flags...

@EmmanuelBeziat
Copy link

Looks like emoji flags are dead 😢

Ah dang, I was just coming to say I have the bug too (WP 6.0 / ACF 5.11 / WooCommerce 6.5.1), and that emojis was an awesome idea.

Too bad :(

@nlemoine
Copy link
Owner

@EmmanuelBeziat However, countries doesn't disappear or show up every morning (although the recent events may remind us that borders are not that set in stone 😞)

I think I'll still push this new update soon.

nlemoine added a commit that referenced this issue Nov 21, 2022
Changes:
- Remove flag image usage in favor of emojis although they're pretty dead (see #48)
- Use WordPress scripts to build assets instead of Laravel Mix
- Bump ACF minimum version to ^6.0
- Bump PHP minimum version to ^7.4 || ^8.0
- Add .wp-env.json to ease local testing/dev
nlemoine added a commit that referenced this issue Nov 21, 2022
Changes:
- Remove flag image usage in favor of emojis although they're pretty dead (see #48)
- Use WordPress scripts to build assets instead of Laravel Mix
- Bump ACF minimum version to ^6.0
- Bump PHP minimum version to ^7.4 || ^8.0
- Add .wp-env.json to ease local testing/dev
- Make `get_countries` public
@nlemoine
Copy link
Owner

nlemoine commented Nov 21, 2022

Finally got a project where I needed to use ACF Country so I decided to give it an update.

You can try it here: https://github.com/nlemoine/acf-country/tree/3.x

I finally went for using emojis flags although they're pretty dead but it provides the huge benefit of ending those Select2 issues. It's also lightweight and faster to show since you can display flags without the need to even use Select2.

Note that it's ACF 6 compatible for now, at least if you use ACF UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants