• Resolved Giannis Kipouros

    (@giannis4)


    Hi,

    I am using the plugin version 2.4.2 and it throws a warning:

    “Warning: Trying to access array offset on null in …\fields\acf-font-awesome-v5.php on line 280”

    After some inspection it looks like it is the function maybe_enqueue_font_awesome(field) that does not validate that $field[‘type’] and $field[‘enqueue_fa’] are set.

    Can you please check this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Are you sure about that plugin version? That would be quite a bit out of date. 4.1.2 is the latest version.

    If you are actually on that old of a version please update this plugin, and go re-save your ACF field groups with this icon field in them. Making sure to double check any settings along the way. In fact that is probably a good first step for you here either way. It feels like for some reason on your site those settings are stored properly in your DB.

    Thread Starter Giannis Kipouros

    (@giannis4)

    Hi,

    You are right, it is version 4.1.2.

    It wont be easy to save all ACF fields since there are too many of them on separate installations.

    Can you add a check on line 279 of acf-font-awesome-v5.php and make it:

    if ( isset( $field['type'] && 
    isset( $field['enqueue_fa'] ) &&
    'font-awesome' == $field['type'] &&
    $field['enqueue_fa'] ) {
    add_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );
    }
    Plugin Author Matt Keys

    (@mattkeys)

    Yes this section can be more ‘defensively’ coded to prevent this error, I’ll look to do that in the next update of this plugin. I’m still not sure why this is coming up on your site though, that code has been in place for some time without any other reports of issues. Presumably there is an edge case unique to your installation but hard to say.

    Thread Starter Giannis Kipouros

    (@giannis4)

    Hi Matt,

    Great! Thank you.

    I am trying to refactor an old site with many customizations. An old setting stored in the DB could be the culprit. Checking before using the array values can cover all cases and avoid unwanted warnings.

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