I'm working on a Drupal 10.5.1 site that's showing me a warning message:
Warning: Undefined array key "#submit_button" in Drupal\Core\Render\Element\Button::preRenderButton() (line 92 of core/lib/Drupal/Core/Render/Element/Button.php).

This looks like it's related to something in the Core innards of Drupal into which I'm not comfortable poking my proverbial finger.

Has anyone else been seeing this message?
Any idea of what I should do - besides ignoring it?

Urban

Comments

dezb’s picture

Hi Urban. I too was presented with the same error after updating the core to 10.5.1. After running cron and clearing all caches the error code has not since presented 🤞.

ulandreman’s picture

Greetings,

Thanks for the note.

My message also went away after a while.
I guess that's good.

Onward...

gayathri09’s picture

Worked for me as well.

alaverde’s picture

This worked for me too. Thank you!

I had to run drush updb also as per the core upgrade guide Updating Drupal core via Composer | Updating Drupal | Drupal Wiki guide on Drupal.org

tolstoydotcom’s picture

The issue says to do what you already did:

https://www.drupal.org/project/drupal/issues/3530911

However, looking at the code, the idea of if ($element['#submit_button']) { without empty/isset doesn't seem great.

Available for paid support, module development, migrations, consulting...