"Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain()
bootstrap.inc" is generated on /admin/structure/types/manage//fields if any of the fields don't have a label.

This is because of the line

'#markup' => check_plain(t($step->label)),

in msnf.field_ui.inc.

t returns an array if no argument or an empty string is passed.

Patch to follow promptly :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Eli-T’s picture

Assigned: Eli-T » Unassigned
Status: Active » Needs review
FileSize
619 bytes

Patch attached - checks step label is set before passed to check_plain(t()).

rooby’s picture

Issue summary: View changes
Related issues: +#2240207: Incorrect use of t() function

I added a related issue but the two issues should still be kept separate.

siliconmeadow’s picture

Status: Needs review » Reviewed & tested by the community

We've been using this patch for quite some time. Back when Eli-T created it, I'm guessing. :-)

Eli-T’s picture

@siliconmeadow there have been no commits to this project for two years it appears. As you're using it on a very large project, may be worth reaching out to @stborchert to see if one of your team can co-maintain?

  • stBorchert committed 58ae2c4 on 7.x-1.x authored by Eli-T
    Issue #2013773 by Eli-T: Fields with no label cause PHP warning on...
stBorchert’s picture

Status: Reviewed & tested by the community » Fixed

... or you can wait until I finally notice this issue and take care of it ;)

I've committed your patch to branch 7.x-1.x so it should be available in the next development release. Thanks for your help.

Eli-T’s picture

Awesome :D

Thanks @stborchert

Status: Fixed » Closed (fixed)

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