A minor warning is being generated by calling array_key_exists() without ensuring that the 1st argument is an array or a string.

Attaching a small patch to fix it.

Comments

renaudcuny created an issue. See original summary.

renaudcuny’s picture

luksak’s picture

Priority: Minor » Normal
Status: Active » Needs review
StatusFileSize
new1.56 KB

I guess the title should rather be casted to a string.

luksak’s picture

Mixed the patch up with code from another issue. Here is the correct patch.

luksak’s picture

StatusFileSize
new708 bytes

Let's hope I got it right this time :)

luksak’s picture

Status: Needs review » Needs work

Actually the patch in #2 works better than mine. The values of $title differ quite a bit depending on the page the breadcrumb is for:

  • Just a string
  • A render array of type markup
  • A \Drupal\Core\StringTranslation\TranslatableMarkup object

What needs to be done here?

greg boggs’s picture

We should write code for each of the 3 options I suppose. How do you generate a page with the later two options?

luksak’s picture

It would just rendered in a Twig file, right?

gg24’s picture

I see https://www.drupal.org/project/easy_breadcrumb/issues/2925736 as the same issue. Here we are trying to fix the same with different approach. Please check.

Thanks!

greg boggs’s picture

Yea, we can close this issue as a duplicate now as I believe gargsuchi has given us a more robust solution in her thread. Yes? No?

~Greg

luksak’s picture

Since the other issue is fixed, I'm closing this issue.