Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Icon picker fields break on ACF 6+ with the latest acf-icon-picker installed (1.9.1) #39

Open
Dennisscholten opened this issue May 31, 2024 · 8 comments

Comments

@Dennisscholten
Copy link

Dennisscholten commented May 31, 2024

I updated to ACF 6.0.1 and noticed some fatal JS errors in the editor when trying to remove flexible fields that have your icon picker fields in it. I updated your plugin to the latest version, but the issue persists. On the ACF admin screen, the old icon picker fields are now named as unknown, while the new ACF native icon picker field is a new option. It looks like a clash between classnames.
Scherm­afbeelding 2024-05-31 om 10 42 39

@blakerr
Copy link

blakerr commented May 31, 2024

Same here, now Im in dilema to stick with the new solution and rewrite my code or to downgrade ACF :(

@Levdbas
Copy link

Levdbas commented May 31, 2024

See #38

I fixed the compat with ACF 6.3. I hope @houke can take a look at this soon!

@Marty861
Copy link

Marty861 commented Jun 1, 2024

See #38

I fixed the compat with ACF 6.3. I hope @houke can take a look at this soon!

Hello guys, does it mean that we can expect new plugin release soon? This plugin is actually much better than official solution released from ACF now and it will be great if both continue to coexist...

@Dennisscholten
Copy link
Author

See #38

I fixed the compat with ACF 6.3. I hope @houke can take a look at this soon!

Hey, thanks for diving into it! I imported your commits, but for some reason it doesn't seem to work on ACF 6.3 but it does for sites with 6.2. Any idea what I missed?

@Dennisscholten
Copy link
Author

When I remove '!' from this line the custom field shows up like expected:

if (!class_exists('acf_field_icon_picker')) :

But: when I try to remove a layout from a flexible field that has the custom icon picker in it, I get a JS error:

TypeError: Cannot read properties of undefined (reading 'apply') at n.<anonymous> (acf.min.js?ver=6.3.0:1:4734) at HTMLDivElement.i (jquery.min.js?ver=3.7.1:2:86755) at HTMLDivElement.dispatch (jquery.min.js?ver=3.7.1:2:40035) at v.handle (jquery.min.js?ver=3.7.1:2:38006) at Object.trigger (jquery.min.js?ver=3.7.1:2:70124) at ce.fn.init.triggerHandler (jquery.min.js?ver=3.7.1:2:70811) at n.trigger (acf.min.js?ver=6.3.0:1:5269) at n.trigger (acf-input.min.js?ver=6.3.0:1:75045) at acf-input.min.js?ver=6.3.0:1:77153 at o (acf.min.js?ver=6.3.0:1:1406)

@Levdbas
Copy link

Levdbas commented Jun 3, 2024

@Dennisscholten , there is quite a lot of interference from the newly introduced icon picker field by ACF. The reason why editing

if (!class_exists('acf_field_icon_picker')) : works is because you overwrite the existing class by ACF, My PR changes that but we haven't heard from @houke yet. Meanwhile @mike-sheppard made a fork were all fixes are merged: https://github.com/smithfield-studio/acf-svg-icon-picker

Depending on whether @houke is going to respond, it could be an idea to move to that fork instead. Be aware, in the current version of that fork the field name has changed, so you will have to change that as well in your field config. I already made a ticket about that at smithfield-studio#1 which I am going to make a PR for as well.

@Levdbas
Copy link

Levdbas commented Jun 4, 2024

There is now a fork available that fixes this issue and more: https://github.com/smithfield-studio/acf-svg-icon-picker

We plan on actively developing this in the future.

@EarthmanWeb
Copy link

Thanks for the efforts all, and the fork @Levdbas - that is great news. Will try that out and report back!!!

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

No branches or pull requests

5 participants