Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 3143531-simple-recaptcha-remove-notice-6.patch | 866 bytes | sokru |
| |||
#3 | 3143531-simple-recaptcha-webform-missing-theme-hook-3.patch | 1.2 KB | sokru |
Comments
Comment #2
sokru CreditAttribution: sokru as a volunteer commentedI 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.Comment #3
sokru CreditAttribution: sokru as a volunteer commentedAnd missing patch.
Comment #4
sokru CreditAttribution: sokru as a volunteer commentedComment #5
sandboxplSee \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:
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...
Comment #6
sokru CreditAttribution: sokru as a volunteer commentedThis patch uses getSummary() approach. It provides only reCaptcha version number on handler summary. This is enough to remove the PHP warning.
Comment #8
sandboxplFair 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!