verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

Wrong event in Icon Set documentation #83

Open espensgr opened 8 months ago

espensgr commented 8 months ago

Describe the bug

Trying to add my own set of icon set from the this example. The EVENT_REGISTER_INTEGRATIONS is missing in the IconSets.php file and results in an error: Undefined constant verbb\iconpicker\services\IconSets::EVENT_REGISTER_INTEGRATIONS Have tried the other events, but i get errors. Is this removed by mistake or is the setup for this changed? The namespacing in the example confuses me a bit too. I'm extending an existing module i have made, maybe thats wrong?

My end goal is to add the Iconify library, if that is to be added natively that would be great :)

Steps to reproduce

  1. Install the plugin, activate it
  2. add iconifyIconSet.php in modules/icons folder that extends IconSet
  3. Register the IconSets::EVENT_REGISTER_INTEGRATIONS in the attachEventHandlers i made with craft modules.

Craft CMS version

4.5.9

Plugin version

2.0.15

Multi-site?

No

Additional context

No response

engram-design commented 8 months ago

That's what I get for copy-pasting! That should be EVENT_REGISTER_ICON_SETS and just updated the docs.

As for the namespace, that's also fixed, hopefully that's clearer now.

espensgr commented 8 months ago

hehe, all good, we have all been there! Got it working with the new event, i just forgot to update the namespace with the folder the file was added in. Would Iconify be a good native addition to the plugin? 😇

PS: the docs still have the EVENT_REGISTER_INTEGRATIONS event 😝

engram-design commented 8 months ago

Probably not a bad idea to have native support! A PR would always be welcome, or we can add it to the todo list.