• Resolved marcsky

    (@marcsky)


    The Plugin doesn’t show the icon selection in the admin anymore.

    I just see the message the results can not be loaded.
    In the log I got :
    [16-Jul-2024 08:21:55 UTC] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in …/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-6.php:202
    Stack trace: 0 …wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-6.php(202): in_array(‘kit_custom’, ”) 1 …/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-6.php(55): ACFFA_Loader_6->get_ajax_query(Array) 2 …/wp-includes/class-wp-hook.php(324): ACFFA_Loader_6->select2_ajax_request(”) 3 …/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) 4 /home/www/dev/feda/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 5 /–/wp-admin/admin-ajax.php(192): do_action(‘wp_ajax_acf/fie…’) 6 {main}

    thrown in …/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-6.php on line 202

    I add a token and a set with my free FA account, still the same.
    I disabled really everything in WP and the functions, still the same.
    I use the 4.0.9 version, the current versions of ACF Pro and WP. PHP is 8.1 (staging) and 8.2 (live)

    • This topic was modified 2 months ago by marcsky.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Hello, thanks for reporting the error. I wonder if you would be comfortable/able to log the value of $active_icon_sets in your environment. In that class-ACFFA-Loader-6.php file mentioned in the error above, right before line #201. You could do it like:

    ...
    $search_custom_icon_set = false;

    file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log_active_icon_sets.txt', print_r($active_icon_sets, true));

    if ( isset( $active_icon_sets ) // Make sure we have an icon set
    ...

    Which would put a txt file called log_active_icon_sets.txt at the root of your site with the value of $active_icon_sets.

    I’m very curious to see what is in this value that isn’t an array.

    Thanks,

    Matt Keys

    Thread Starter marcsky

    (@marcsky)

    Some Minutes before your message I found a way to fix it. The problem comes from old ACF field. When I add a new FA field everything is working. At the end I duplicated the field, delete the old and rename the duplicated field to the original filed name. Just saving the field group was not working.
    In the Website the FA field ist probably 4, 5 years old.

    Plugin Author Matt Keys

    (@mattkeys)

    Okay that does make some sense if you were maybe upgrading from a site that used this plugin with FontAwesome 4.x icons. The concept of ‘active icon sets’ didn’t exist back then. I should still add a sanity check in the code here to make sure that there is an array before trying to use it. I’ll look to do that in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.