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.
with this small change, drupal_delete_add_form_elements()
becomes a far more flexible function. it was originally written just to help handle building the multiple delete confirm screens, but this tweak enables it to be used generally anywhere that a module would like to inject a piece of a form into a confirm screen. great use case is for putting a message into the confirm form directly from hook_nodeapi 'delete' op.
initial testing is good. i'll run a few more tests to make sure it doesn't break any current functionality...
Comment | File | Size | Author |
---|---|---|---|
#4 | dapi_form_elements.patch | 1.56 KB | hunmonk |
dapi_35.patch | 1.03 KB | hunmonk | |
Comments
Comment #1
hunmonk CreditAttribution: hunmonk commentedtested extensively -- this works beautifully and makes the function much more powerful.
Comment #2
hunmonk CreditAttribution: hunmonk commentedthis is actually a bug in the code -- the function should be able to be called from anywhere once a package is open.
Comment #3
pwolanin CreditAttribution: pwolanin commentedI tested the patch as far as adding elements to the confirm form via hook_nodeapi and it worked for me.
Comment #4
hunmonk CreditAttribution: hunmonk commentedmetadata would also benefit from the recursive merging that the form elements were moved to. attached patch implements this. tested and ready to go.
Comment #5
hunmonk CreditAttribution: hunmonk commentedComment #6
webchickDeletion API was rolled back.