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

feat: Fix compat with ACF 6.3 #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Levdbas
Copy link

@Levdbas Levdbas commented May 16, 2024

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 Levdbas changed the title feat: create properties feat: Fix compat with ACF 6.3 May 31, 2024
@Levdbas
Copy link
Author

Levdbas commented May 31, 2024

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.

@blakerr
Copy link

blakerr commented May 31, 2024

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!

@phschmanau
Copy link

@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.

@Levdbas
Copy link
Author

Levdbas commented Jun 4, 2024

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

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

Successfully merging this pull request may close these issues.

3 participants