Problem/Motivation

I get the gollowing error when viewing an entity using this formatter

Deprecated function: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in template_preprocess_image_formatter_link_to_image_style_formatter() (line 40 of modules/contrib/image_formatter_link_to_image_style/image_formatter_link_to_image_style.field.inc).

Steps to reproduce

In my particular case this is happening when I have an image field on a media entity, then upload and save image media entities with entity_browser.

CommentFileSizeAuthor
#3 image-issue-3374852-1.patch580 byteskapil-s
#2 issue-3374852-1.patch580 bytesloze
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:

Comments

loze created an issue. See original summary.

loze’s picture

StatusFileSize
new580 bytes

here is a small patch that gets rid of the error

kapil-s’s picture

StatusFileSize
new580 bytes

this is a small patch that gets rid of the error

keshav.k made their first commit to this issue’s fork.

keshavv’s picture

Status: Active » Needs work

@kapil-virasat
Please always attach an interdiff of the patch.
Sorry to say' But you just created a duplicate patch of the existing one. Which is not correct.
Please do a meaningful contribution. Otherwise, it will be a waste of time.

Thank you!

keshavv’s picture

Status: Needs work » Needs review

The #2 patch working well, Made a little change to it and created the MR.
Please review.
Thank you.

loze’s picture

Status: Needs review » Reviewed & tested by the community

MR2 works well for me. Its a simple enough change, marking as RTBC to help move it along.

  • facine committed 1cd38525 on 8.x-1.x authored by keshavv
    Issue #3374852: Getting PHP errors: Deprecated function: mb_strlen()
    
facine’s picture

Status: Reviewed & tested by the community » Fixed

Fixed! Thanks

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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