Fatal error info:
Recoverable fatal error: Argument 3 passed to slick_get_image() must be of the type array, null given

Comments

msgph created an issue. See original summary.

msgph’s picture

Status: Active » Needs review
gausarts’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thank you.

The $items are passed from slick_fields_field_formatter_view():
http://cgit.drupalcode.org/slick/tree/slick_fields/slick_fields.module?h...

Perhaps we should move it into slick_fields_field_formatter_view()?

If not, we may have to pass it into other two places:
http://cgit.drupalcode.org/slick/tree/includes/slick.media.inc?h=7.x-2.x#n8
http://cgit.drupalcode.org/slick/tree/includes/slick.field_collection.in...

The latter solution is also reasonable as sometimes I just pick up slick_format_image() without needing for slick_fields_field_formatter_view() such as from within a block.
But the first is quicker route.

Thoughts?

msgph’s picture

StatusFileSize
new488 bytes

Good point. I agree, the first is the quicker and more efficient route.

Here's a new patch.

msgph’s picture

Status: Postponed (maintainer needs more info) » Needs review
gausarts’s picture

Thank you.

Please allow some delay to get back on this ;)

gausarts’s picture

Status: Needs review » Postponed (maintainer needs more info)

Recoverable fatal error: Argument 3 passed to slick_get_image() must be of the type array, null given

I am trying to replicate the error, but I couldn't.
Could you please paste the complete error log, so we can track down what caused this?

Seeing the given errors, Argument 3 refers to $settings parameter, not $items.

I deleted images, and no errors thrown.
I deleted Media file entities, and no errors, either.
Assumed we are on the same 7.x-2.x-dev as you reported.

Would you mind providing steps to re-produce it?
I need to make sure what is going on, for just in case this is not about $items.

Thanks.

msgph’s picture

Error message:

Recoverable fatal error: Argument 3 passed to slick_get_image() must be of the type array, null given, called in sites/all/modules/contrib/slick/includes/slick.image.inc on line 38 and defined in slick_get_image() (line 61 of sites/all/modules/contrib/slick/includes/slick.global.inc

Steps to reproduce (this is probably an edge case, but this is how we got the error):
1. Add an image(s) to field
2. Delete the image's file row entry from file_managed table.

gausarts’s picture

Almost similar to what I experienced with media file entity last time with some corrupt import as noticed here:
http://cgit.drupalcode.org/slick/tree/includes/slick.media.inc?h=7.x-2.x...

Your solution seems to address this type of issue much better.

Thank you.

  • gausarts committed 1c4619c on 7.x-2.x authored by msgph
    - #2867683 by msgph: Fix fatal error when referenced image does not...
gausarts’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sorry for delay on this. I must have been very busy with D8 ;)

I changed lining a bit to match the rest below, hopefully doesn't change the essence.

Committed. Thank you for contribution.

Status: Fixed » Closed (fixed)

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