Overzealous hijacking of the signup broadcast form

dww - August 22, 2009 - 17:43
Project:Signup Status
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:dww
Status:closed
Description

When signup_status hijacks the signup broadcast form, it just does this:

<?php
 
// Overwrite the submit hook, in case the user selects a specific status.
 
$form['#submit'] = array('signup_status_signup_broadcast_form_submit');
?>

That would break anyone *else* trying to alter this form to do anything. A safer approach would be this:

<?php
 
// Replace the default submit handler in case the user restricts by status.  
 
foreach ($form['#submit'] as $key => $handler) {
    if (
$handler == 'signup_broadcast_form_submit') {
      unset(
$form['#submit'][$key]);
      break;
    }
  }
 
$form['#submit'][] = 'signup_status_signup_broadcast_form_submit';
?>

That would still let other things alter this form and trigger other actions when it's submitted, while still preventing signup's default submit handler from being called.

#1

dww - August 22, 2009 - 17:44
Status:active» fixed

Committed to HEAD.

#2

System Message - September 5, 2009 - 17:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.