WPIntell

Source evidence

Warning: Trying to access array offset on null

Advanced Custom Fields: Font Awesome Field · support · 2025-03-05T06:42:00+00:00

mixedsentiment
mediumseverity
0.84relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 31 rows with source links

16.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Giannis Kipouros resolved
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? 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. 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' ) ); } 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. 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.

Comments

4 shown
Matt Keys 2025-03-05T18:21:00+00:00

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.

Giannis Kipouros 2025-03-05T18:57:00+00:00

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' ) ); }

Matt Keys 2025-03-05T19:43:00+00:00

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.

Giannis Kipouros 2025-03-05T20:01:00+00:00

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.