I am having a hard time finding documentation on this.

Essentially, our company printed several thousand fliers with a coupon code (from UC_Coupon) which is too long to actually fit in the field that UC_Coupon provides.

$form['code'] = array(
    '#type' => 'textfield',
    '#title' => t('Coupon code'),
    '#description' => t('Coupon codes cannot be changed once they have been used in an order.'),
    '#default_value' => $value->code,
    '#size' => 25,
    '#required' => !$used,
    '#maxlength' => 14,
    '#disabled' => $used,
  );

I just want to hit, then, "$form['code'] = array, specifically the #size field, and change it to 35.

I don't want to update the module physically because then I have to do that everytime we upgrade.

Can't I write a snippet of code, throw it in my sites/default/etc folder, and have it modify that one piece?

Even a link to a page talking about it would help. Thanks in advance.

Comments

pbarnett’s picture

It may be possible to use a variant of hook_form_alter in a custom module to change this - see http://api.drupal.org/api/function/hook_form_FORM_ID_alter/6

streever’s picture

Should I make a custom module, basically, or put this in my template.php file? Just not sure where to put it--thanks!

I provide free Drupal support on Thursdays: booking calendar coming soon.

xjkwak’s picture

A module to custom that form.

pbarnett’s picture

AFAIK, implementations of the hook_xxx functions have got to be in a module in order for them to get called.

streever’s picture

Thanks a lot folks! It sounds like I have to create a custom module ("Overwrite_module" or something) and just put in the hook implementation. Can do. Thanks for the help, it is greatly appreciated as always!

I provide free Drupal support on Thursdays: booking calendar coming soon.

pbarnett’s picture

No problem; it's what we're here for :-)