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.
We use several ways to pass the flag to validate/submit handlers:
- flag_form() uses $form['#flag']
.
- flag_delete_confirm() does $form['fid'] = array('#type' => 'value', '#value' => $flag->fid)
- flag_confirm() does $form['flag_name'] = array('#type' => 'value', '#value' => $flag_name)
.
- I'm using $form_state['flagging']
for #871064: Making flaggings fieldable.
What should we do about this?
Comment | File | Size | Author |
---|---|---|---|
#4 | 887360.flag_.standardize-form-flag.patch | 1.96 KB | joachim |
Comments
Comment #1
quicksketchOut of these, $form['#flag'] would be my preference.
Comment #2
mooffie CreditAttribution: mooffie commentedOK, I'll provide a patch after #887324: Modernize the menu items is committed (because it provides the $flag variable).
Comment #3
joachim CreditAttribution: joachim commented$form['#flag'] is the standard on D7 for passing things to submit handlers.
Comment #4
joachim CreditAttribution: joachim commentedComment #5
joachim CreditAttribution: joachim commented#4: 887360.flag_.standardize-form-flag.patch queued for re-testing.
Comment #6
joachim CreditAttribution: joachim commentedWhat is it with testbot at the moment?
Quicker to run the tests myself...