Hello;

On a fresh module install several PHP errors surfaced related to the count() function being passed a non-countable NULL value.

This won't prevent the module from working but will pollute the messages area with tons of warnings.

The attached patch solves this problem.

Comments

idiaz.roncero created an issue. See original summary.

idiaz.roncero’s picture

StatusFileSize
new642 bytes
idiaz.roncero’s picture

Status: Active » Needs review
natts’s picture

Status: Needs review » Fixed

Thanks for spotting this. I'll put an alternative fix (that doesn't unnecessarily define a new variable) in the next release:

$quantity = is_array($service->get('hostnames')) ? count($service->get('hostnames')) : 1;

  • natts committed d346acd on 8.x-2.x
    Fixed issue #3127787: Count warning when passing NULL
    

Status: Fixed » Closed (fixed)

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