acf-icon-picker icon indicating copy to clipboard operation
acf-icon-picker copied to clipboard

feat: Fix compat with ACF 6.3

Open Levdbas opened this issue 1 year ago • 4 comments

Hi @houke ,

Thanks for your work on this plugin! This PR creates the properties in advance to prevent dynamic creation of properties warnings in PHP 8.2 and above. I do have some other ideas as well for this plugin to further modernize the codebase if you're open to that.

Looking forward to your reply!

Update 31-05

Advanced custom fields 6.3 is now available and introduces it's own icon picker.

The class acf_field_icon_picker used in the plugin interfered with the new ACF field that has exactly the same classname. My new set of changes do the following:

  • Rename the field label to Icon field (custom) to differentiate between the two fields.
  • move the field to the new category advanced since jquery is no longer an existing category
  • Renamed the class from acf_field_icon_picker to acf_field_custom_icon_picker so it does not longer interfere

After this the plugin loads again as needed. I would really like to have an update for this since this breaks quite a lot of websites I run. I am open for any suggestions you have!

Levdbas avatar May 16 '24 12:05 Levdbas

Hi @houke ,

Sorry for being annoying with the mentions, but I would really like to have this fix out as soon as possible. Let me know if I can help in any way to speed this up.

Levdbas avatar May 31 '24 18:05 Levdbas

Hi @houke ,

Thanks for your work on this plugin! This PR creates the properties in advance to prevent dynamic creation of properties warnings in PHP 8.2 and above. I do have some other ideas as well for this plugin to further modernize the codebase if you're open to that.

Looking forward to your reply!

Update 31-05

Advanced custom fields 6.3 is now available and introduces it's own icon picker.

The class acf_field_icon_picker used in the plugin interfered with the new ACF field that has exactly the same classname. My new set of changes do the following:

* Rename the field label to **Icon field (custom)** to differentiate between the two fields.

* move the field to the new category `advanced` since `jquery` is no longer an existing category

* Renamed the class from `acf_field_icon_picker` to `acf_field_custom_icon_picker` so it does not longer interfere

After this the plugin loads again as needed. I would really like to have an update for this since this breaks quite a lot of websites I run. I am open for any suggestions you have!

Thank you for the solution provided!

blakerr avatar May 31 '24 21:05 blakerr

@Levdbas Thanks for this solution! I wondered, why it's not working anymore. 😉

On line 7 of the file fields/acf-icon-picker-v5.php I also had to change if (!class_exists('acf_field_icon_picker')) : to if (!class_exists('acf_field_custom_icon_picker')) : so that the plugin works again.

phschmanau avatar Jun 04 '24 10:06 phschmanau

Hi @blakerr , @phschmanau: 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

Levdbas avatar Jun 04 '24 10:06 Levdbas