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

Brands only showing up when "All" styles is selected #97

Open pascalminator opened 1 month ago

pascalminator commented 1 month ago

Describe the bug

If I manually check some styles including "Brands" instead of selecting "All", the brands are not showing up in the search results of the icon field. I tried many different combinations, and the only way to get brands in the field is by checking "All".

Brands not showing up: image

Brands showing up: image

Steps to reproduce

  1. Uncheck "All" in "Styles" and check some other styles, including "Brands"
  2. Try to find a brand (Facebook, Instagram, wathever) in the field without any success.
  3. Check "all" styles and try again. Now the brands are showing up.

Craft CMS version

5.4.7.1

Plugin version

3.0.1

Multi-site?

No

Additional context

No response

engram-design commented 1 month ago

Fixed for the next release. To get this early, run composer require verbb/icon-picker:"dev-craft-5 as 3.0.1". Note that you'll need to re-save your Icon Set, as the "Brands" style had an incorrect value.

pascalminator commented 5 days ago

This is fixed if I check "Brands" and at least one other style but if I check only "Brands" and nothing else, there is an error: image

Getting this problem with Icon Picker 3.0.2.

engram-design commented 5 days ago

I'm not seeing that on my end, sorry. What are your icon set settings?

Anything in your logs?

CleanShot 2024-11-21 at 11 38 23@2x

pascalminator commented 5 days ago

My settings are the same as in your screenshot, but my kit use Font Awesome 6 Pro instead of 5 Free.

Here is what I found in the queue log:

2024-11-21 08:49:46 [queue.ERROR] [craft\queue\QueueLogBehavior::afterError] [460] Generating icon cache for "brands" (attempt: 1, pid: 237732) - Error (time: 0.002s): verbb\iconpicker\iconsets\FontAwesome::getKit(): Return value must be of type array, null returned {"memory":2383672} 2024-11-21 08:49:46 [queue.ERROR] [TypeError] TypeError: verbb\iconpicker\iconsets\FontAwesome::getKit(): Return value must be of type array, null returned in /var/www/html/vendor/verbb/icon-picker/src/iconsets/FontAwesome.php:298

siebird commented 5 days ago

I'm getting the same error today as well. The icons stopped working and I'm not seeing any kits to select from.

CleanShot 2024-11-21 at 11 10 43


2024-11-21 10:47:22 [ERROR] FontAwesome Kit API error: “error code: 502” /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
2024-11-21 10:47:22 [INFO] Request context:
$_GET = []```
engram-design commented 4 days ago

@pascalminator Just wanted to confirm your kits settings?

image

@siebird A 502 Bad Gateway might be unrelated to this one. Can you clear Craft caches and try again?

pascalminator commented 4 days ago

Here you go for my kit settings:

config-fa-kit

engram-design commented 17 hours ago

Looks all correct to me, thanks for sending through. I have just pushed a fix for this error, but more to the point - I'm not quite sure why it's reporting back as no icons, so this might not fix the underlying issue.

To get this early, run composer require verbb/icon-picker:"dev-craft-5 as 3.0.1".

d-karstens commented 15 hours ago

We have been running into the same 502 error issue as well, have tried with the above fix and it didn't seem to help

2024-11-26 14:45:18 [ERROR] FontAwesome Kit API error: “error code: 502” /app/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
2024-11-26 14:45:18 [INFO] Request context:
$_GET = []

$_POST = []
d-karstens commented 15 hours ago

Unsure if it's relevant, but we have 2 staging environments and a local - the error occurs on our local environment and one of the staging environments, but everything works normally on the other staging

They're all using the same API key

d-karstens commented 14 hours ago

We managed to figure it out from there, generating a new API key for each environment solved it 👍

engram-design commented 12 hours ago

Yeah, that fix would've just "got out of the way" for any request-related errors, which the 502 error was the underlying one.

Good to know about the API key, maybe there were limits being hit?