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.
PLEASE put form actions in an 'actions'
wrapper and give them names. Docs: http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...
Several reasons:
- The buttons are now combined and weightable together
- Themes (and the Form system) can position them correctly
- Extending modules will know what to alter
This is just horrible:
$form[] = array(
'#type' => 'submit',
'#value' => t('Delete'),
'#validate' => array('nodequeue_edit_queue_form_delete_validate'),
'#submit' => array('nodequeue_edit_queue_form_delete_submit'),
);
It doesn't even have a name! How are other modules supposed to hook into it?
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1442928.patch | 1.53 KB | SebCorbin |
#3 | form-element-names.patch | 1.23 KB | rudiedirkx |
form-buttons.patch | 815 bytes | rudiedirkx | |
Comments
Comment #1
rudiedirkx CreditAttribution: rudiedirkx commentedAlmost the same goes for the operations/actions links in
nodequeue_view_queues()
. If you'd give them names, other modules could do something with them.Comment #2
amateescu CreditAttribution: amateescu commentedHa, good catch about the missing names :) Can you provide a patch for operations as well?
Comment #3
rudiedirkx CreditAttribution: rudiedirkx commentedAh man =)
Okay, here it is.
Comment #4
rudiedirkx CreditAttribution: rudiedirkx commentedActually there's another location this would be good...
You can write that without the markup element so that modules can influence it:
So that other modules can add
#access = FALSE
.But that's tiny minor tiny and I'm not making a patch for that =)
The main issue is the biggest: form actions in an
actions
wrapper and named.Comment #5
rudiedirkx CreditAttribution: rudiedirkx commentedComment #7
rudiedirkx CreditAttribution: rudiedirkx commentedWhy doesn't it apply? Works fine for me locally... The GIT commit ID's are nonsense, but that shouldn't matter. The paths are correct, right?
Comment #8
recidive CreditAttribution: recidive commented@rudiedirkx: Is the patch for 3.x or 2.x ?
Comment #9
rudiedirkx CreditAttribution: rudiedirkx commentedI thought 3, but apparently 7.x-2.0-beta1... Crap. Make new patch? =)
Comment #10
SebCorbin CreditAttribution: SebCorbin commentedComment #11
rudiedirkx CreditAttribution: rudiedirkx commentedThanks SebCorbin, but I think they want a patch for 3.x. Maybe I'm wrong?
Comment #12
SebCorbin CreditAttribution: SebCorbin commentedCommitted to both 7.x-2.x and 7.x-3.X