• Resolved Andrei

    (@critick)


    PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in wp-content\plugins\advanced-custom-fields-font-awesome\fields\acf-font-awesome-v7.php:247

    Stack trace:

    #0 wp-content\plugins\advanced-custom-fields-font-awesome\fields\acf-font-awesome-v7.php(247): implode(‘,’, ”)

    I’m using PHP 8.3.
    v5.0.2 is still working fine for us.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Justin Kruit

    (@justinkruit)

    Thanks for the stack trace!

    If you’re comfortable with editing the code, could you run a var_dump on $field within the render_field() function in advanced-custom-fields-font-awesome\fields\acf-font-awesome-v7.php? If not, that’s also completely fine, just let me know!

    When I have more info or if you’re not comfortable with editing the code, I’ll get working on a fix asap.

    Thread Starter Andrei

    (@critick)

    Hi Justin!
    Sure, here you are:

    array(30) { ["ID"]=> int(0) ["key"]=> string(19) "field_66ebeb766da27" ["label"]=> string(4) "Icon" ["name"]=> string(66) "acf[field_66ebe9fe6da24][field_66ebeb376da26][field_66ebeb766da27]" ["aria-label"]=> string(0) "" ["prefix"]=> string(45) "acf[field_66ebe9fe6da24][field_66ebeb376da26]" ["type"]=> string(4) "text" ["value"]=> string(92) "{"family" : "sharp", "style" : "light", "id" : "gear", "label" : "Gear", "unicode" : "f013"}" ["menu_order"]=> int(0) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(63) "acf-field_66ebe9fe6da24-field_66ebeb376da26-field_66ebeb766da27" ["class"]=> string(0) "" ["conditional_logic"]=> int(0) ["parent"]=> string(19) "field_66ebeb376da26" ["wrapper"]=> array(3) { ["width"]=> string(2) "20" ["class"]=> string(0) "" ["id"]=> string(0) "" } ["icon_sets"]=> string(0) "" ["custom_icon_set"]=> string(0) "" ["default_label"]=> string(64) "<i class="fa-sharp fa-light fa-gear fa-fw"></i> Gear" ["default_value"]=> string(92) "{"family" : "sharp", "style" : "light", "id" : "gear", "label" : "Gear", "unicode" : "f013"}" ["save_format"]=> string(7) "element" ["allow_null"]=> int(0) ["show_preview"]=> int(1) ["enqueue_fa"]=> int(1) ["allow_in_bindings"]=> int(0) ["fa_live_preview"]=> string(0) "" ["choices"]=> array(0) { } ["_name"]=> string(4) "icon" ["_valid"]=> int(1) ["_prepare"]=> bool(true) } 

    But I tested a small check and seems like it’s working fine with it (line 197, right after $field['icon_sets']  = ... string):

    if (! is_array($field['icon_sets'])) {

              $field['icon_sets'] = ! empty($field['icon_sets']) ? [(string) $field['icon_sets']] : [];

    }
    Plugin Author Justin Kruit

    (@justinkruit)

    Thanks!

    Can I assume that the field is set to basically support all icon families, by not selecting any family? As it is an empty string, and I recreated the behavior by saving the field settings with no families selected.

    I’ve fixed it in this commit: https://github.com/justinkruit/Advanced-Custom-Fields-Font-Awesome/commit/593497ca1a66f968eab00e830b7483985d609ace

    I’ll make a bugfix release in a couple of hours!

    Thread Starter Andrei

    (@critick)

    I’m not sure what do you mean, I have my FA kit selected, and a FA version is 7.x.

    But anyway thank you very much Justin, waiting for the plugin update then!

    • This reply was modified 1 month ago by Andrei.
    Plugin Author Justin Kruit

    (@justinkruit)

    No problem, I may was a bit unclear in my previous message.

    A v6.0.2 release has just been published which should resolve this issue!

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.