Problem/Motivation

When I use the Admin Toolbar module's option to clear the caches the following error is logged:

Warning: in_array() expects parameter 2 to be array, string given in Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->normalizeText() (line 895 of modules/contrib/easy_breadcrumb/src/EasyBreadcrumbBuilder.php).

Initially I thought this was only on the logging page, but it seems to be on all admin pages.

Steps to reproduce

Go to an admin page.
Use Admin Toolbar to clear the site's caches.

Proposed resolution

Fix the bug ;-)

Remaining tasks

Fix the bug ;-)

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Title: Error on admin/config/development/logging when clearing caches » Error on admin pages
Issue summary: View changes
damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new961 bytes

The $ignored_words variable is expected to be an array but it's stored as a string and never converted to an array. So I added an explode() to convert it to an array.

mchamps’s picture

The patch worked for me. Cheers

neslee canil pinto’s picture

@DamienMcKenna thanks for reporting this. I tried to reproduce this using your steps, but i am not getting this error message logged.

mrcdrx’s picture

Patch in #3 worked for me. Thanks!

damienmckenna’s picture

@mrcdrx: Are you able to confirm the bug?

mrcdrx’s picture

@DamienMcKenna we let users add a node without access to the admin theme and this error was thrown when using the 'preview' button on node creation.

neslee canil pinto’s picture

@here as a couple of people have confirmed this as a bug.
Another issue reported today - #3205407: Warning: in_array() expects parameter 2 to be array, string given in Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->normalizeText() (line 895 of modules/contrib/easy_breadcrumb/src/EasyBreadcrumbBuilder.php).

PS: I was and still not able to reproduce this issue and getting the below error after applying the patch

Warning: explode() expects parameter 2 to be string, array given in Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->normalizeText() (line 887 of /sites/optimus/web/modules/custom/easy_breadcrumb/src/EasyBreadcrumbBuilder.php)
jcontreras’s picture

I can confirm I was having the same problem. I was able to fix the issue with patch #2 on https://www.drupal.org/project/easy_breadcrumb/issues/3205407 - discard this comment.

renatog’s picture

Status: Needs review » Reviewed & tested by the community

#3 worked

  • RenatoG committed fcfacb7 on 8.x-1.x authored by DamienMcKenna
    Issue #3204336 by DamienMcKenna, mrcdrx, Neslee Canil Pinto, jcontreras...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

committed to the dev branch

Thank you so much everyone

neslee canil pinto’s picture

Status: Fixed » Needs work

@RenatoG after committing we are now below error, did you tested it before commiting?

Warning: explode() expects parameter 2 to be string, array given in Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->normalizeText() (line 887 of /sites/optimus/web/modules/custom/easy_breadcrumb/src/EasyBreadcrumbBuilder.php)
jsidigital’s picture

@Neslee
I also have errors on Dev version.

@RenatoG
Is there an update or patch for the Dev version to avoid these errors?

Thank you.

  • RenatoG committed e4a5f17 on 8.x-1.x
    Revert "Issue #3204336 by DamienMcKenna, mrcdrx, Neslee Canil Pinto,...
renatog’s picture

Sorry, my first test was a false-positive. It really happens

@jsidigital not for now, but I'd just reverted the patch #3

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new675 bytes

How about this?

neslee canil pinto’s picture

Status: Needs review » Fixed

Committed to dev branch, and now its error free. Thanks.

Status: Fixed » Closed (fixed)

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