Repository navigation
Conversation
…ent are up for selection in the signature handler
stankut
left a comment
There was a problem hiding this comment.
good job!
commented on the few things i could dig
| break; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
according to this code, we allow multiple handlers of type os2forms_digital_signature , however if multiple of them are referencing to the same element, it will always be a first handler that gets processed.
Not a bug/issue, but something to be aware about
| // and render the validation text consistently. | ||
| $elementKey = $element['#webform_key'] ?? NULL; | ||
| if ($elementKey !== NULL) { | ||
| foreach ($webform_submission->getWebform()->getHandlers('os2forms_digital_signature') as $handler) { |
There was a problem hiding this comment.
This only checks whether the handler is globally enabled, but Webform also skips handlers whose per-submission conditions do not match. In that case preSave() does not sign the document, while this code still sets #digital_signature = TRUE and generates an unsigned PDF containing signature-validation text. Please also check $handler->checkConditions($webform_submission) here.
suggestion how to change it:
$handler->isEnabled()
&& $handler->checkConditions($webform_submission)
&& ($settings['attachment_element'] ?? '') === $elementKey
| return []; | ||
| } | ||
|
|
||
| $elements = $webform->getElementsInitializedAndFlattened(); |
There was a problem hiding this comment.
os2forms_attachment also supports export_type: html, but all such elements are currently added to the selector.
Selecting one makes preSave() write HTML content to a .pdf file and send it to the signing service as a PDF. Please filter these options to #export_type === 'pdf' and add equivalent runtime validation.
|
Please wait to merge this PR until the Drupal 11 release is out. |
|
@jekuaitk this PR may be merged to develop-branch when the corrections is made. |
Solves #348