Problem/Motivation

I'm getting the PHP notice from some of my drupal 7 web pages 'Notice: Trying to access array offset on value of type null in _cdn_build_css_path() (line 146 of ../cdn/cdn.basic.css.inc)'.
PHP Version : 7.4.15

Issue fork cdn-3201566

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

akhilavnair created an issue. See original summary.

akhilavnair’s picture

Issue summary: View changes

Wim Leers’s picture

Status: Active » Needs work
Issue tags: +PHP 7.4

Looks like this MR is causing tests to fail:

fail: [Other] Line 499 of sites/all/modules/cdn/tests/cdn.test:
cdn_file_url_alter() works correctly.

Did you investigate? 😊

I bet this is a PHP 7.4 compatibility thing.

akhilavnair’s picture

Hi Wim Leers,

Yeah this is a PHP compatibility issue.

Wim Leers’s picture

Thanks for confirming 😊

Could you please improve the merge request so it doesn't cause tests to fail? Looks like the cure is worse than the disease right now 😅

nicolabeghin’s picture

Any update on this?

Wim Leers’s picture

The merge request is not passing tests due to this change. Which means this is a net regression.

That being said; I'm queuing an explicit test against PHP 7.4, which this issue is aiming to improve compatibility with. It just can't come at the cost of PHP 7.0 compatibility.

Olarin’s picture

Status: Needs work » Needs review

Based on my local testing, it seems that particular test is already failing WITHOUT the above change, suggesting it is not related. (Which would make sense, because it's hard to see how the minimal change in question - checking isset on a variable before using it, and using an empty string instead if it's not set - could cause such a test regression.)

Wim Leers’s picture

Category: Support request » Bug report
Status: Needs review » Reviewed & tested by the community

D'oh of course — mea culpa! 🙈 I should've checked https://www.drupal.org/pift-ci-job/2186474, that has the exact same failure indeed. Merging!

Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

  • Wim Leers committed f4dd62e on 7.x-2.x authored by akhilavnair
    Issue #3201566 by akhilavnair, Wim Leers, Olarin: Notice: Trying to...
Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Anaconda777’s picture

Hi,

I have 7.x-2.10 version and getting this error with PHP 7.4.30.

Please let me know how can I fix my version? I know how to patch with composer,
but this issue seems to have no patch, even it is fixed?

Wim Leers’s picture

Sorry, I have not shipped a release yet since this was committed. If you want to fix right now, install the latest development snapshot. My apologies!