Ways to reproduce the issue:

Enable simple_recaptcha_webform module, add recaptcha handler to webform. Everytime you load page /admin/structure/webform/manage/{WEBFORM_ID}/handlers PHP Warning Theme hook webform_handler_simple_recaptcha_summary not found. is produced.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sokru created an issue. See original summary.

sokru’s picture

I tried to add hook_theme to simple_recaptcha_webform.module file, but I guess its because handler ID is simple_recaptcha it won't be recognized and it needs to go inside of parent module.

sokru’s picture

And missing patch.

sokru’s picture

Status: Active » Needs review
sandboxpl’s picture

Status: Needs review » Needs work

See \Drupal\webform\Plugin\WebformHandlerBase::getSummary()
https://git.drupalcode.org/project/webform/-/blob/8.x-5.x/src/Plugin/Web...

When custom webform handler extends from it and doesn't provide it's own summary,
it will inherit from base and try to call theme hook created from plugin ID:

'#theme' => 'webform_handler_' . $this->pluginId . '_summary',

I think that It will be cleaner to add implementation of getSummary() in SimpleRecaptchaWebformHandler:
https://git.drupalcode.org/project/simple_recaptcha/-/blob/8.x-1.x/modul...

sokru’s picture

Status: Needs work » Needs review
FileSize
866 bytes

This patch uses getSummary() approach. It provides only reCaptcha version number on handler summary. This is enough to remove the PHP warning.

sandboxpl’s picture

Status: Needs review » Fixed

Fair enough to keep dblog empty, I don't think that adding custom message to the summary will be good idea, let's try keep that table column clean. Thanks!

Status: Fixed » Closed (fixed)

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