Notice: Trying to access array offset on value of type null in advagg_get_css_aggregate_contents() (line 872 of foo/sites/all/modules/contrib/advagg/advagg.missing.inc).

$ php -v

PHP 7.4.3 (cli) (built: May 26 2020 12:24:22) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

toomanypets created an issue. See original summary.

thalles’s picture

Status: Active » Needs work
Kevin Morse’s picture

So a few lines above, the code checks if (empty($info_on_files[$cid]['content_hash']))

Since this line isn't throwing any error, I am assuming we could use this same test to see if $info_on_files[$cid]['content_hash'] is null before doing the test on line 872 that is throwing the Notice if ($info_on_files[$cid]['content_hash'] !== $file_contents_hash)

Since something that is null is not going to equal the hash of a file. We can probably change the test to be if empty() or the original test.

Thoughts?

rishabhthakur’s picture

Assigned: Unassigned » rishabhthakur
Kevin Morse’s picture

Here is my attempt at a patch.

This also fixes another PHP 7.4 issue that I was having.

Kevin Morse’s picture

I think my patch was not in utf8 so that's why it couldn't apply?

rishabhthakur’s picture

Assigned: rishabhthakur » Unassigned

hi @kavin Morse
Please let me know if need then i will look on it

rishabhthakur’s picture

Status: Needs work » Needs review

Modify @kevin patch with 7.x-2.x-dev branch code and add some coding standard format.

rishabhthakur’s picture

Kevin Morse’s picture

Hi Rishabh,

Thanks for fixing my patch. I have queued up an additional test using PHP 7.4 and MySQL 5.7 since this patch is meant to address a PHP 7.4 issue.

Kevin Morse’s picture

I have been using this patch in production for a few weeks now with no issue.

Would be great if someone else could also test it.

joaopauloscho’s picture

Status: Needs review » Reviewed & tested by the community

The patch #9 works for me.

  • thalles committed c194fe5 on 7.x-2.x authored by rishabhthakur
    Issue #3153290 by Kevin Morse, rishabhthakur: [PHP 7.4.3] Trying to...
thalles’s picture

Status: Reviewed & tested by the community » Fixed
thalles’s picture

Thanks @all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.