The markup that Drupal Forms API was inserting for my "sender name" field was casusing some troubles, as it was named as the login form "user name".
I changed the field name in the form array, renaming "name" to "sender_name" in lines 254, 412, 432, 444.

I could make a patch, but I don't know why it marks all my code as new...

Comments

eric_a’s picture

This would break existing ecard_form alters on ['name']/ [block[0]['name']. I vote for a different solution. Could you clarify the issue with the markup a little more?

EDIT: fixed error in fieldname. BTW: it would not just break existing alters but any manipulation that involves this field, for example custom validation and submit handlers that depend on this form field.

dries arnolds’s picture

Eric, I think zetxek only wants to use different translation strings, not variable names. My php skills are meager at best, but this wouldn't be a problem, would it:

Line 252:

  //senders name
  $form['name'] = array(
    '#title' => t('Your name'),
    '#type' => 'textfield',
    '#required' => variable_get('ecard_require_name', 0)
  );
  //sending from
  $form['from_email'] = array(
    '#title' => t('Your email'),
    '#type' => 'textfield',
    '#required' => TRUE
  );

Change to:

  //senders name
  $form['name'] = array(
    '#title' => t('Sender name'),
    '#type' => 'textfield',
    '#required' => variable_get('ecard_require_name', 0)
  );
  //sending from
  $form['from_email'] = array(
    '#title' => t('Sender email'),
    '#type' => 'textfield',
    '#required' => TRUE
  );
kars-t’s picture

Status: Needs review » Fixed

#447422 by Pixelstyle: Added Change name of sender field to allow better theming.

Changed in all versions.

Status: Fixed » Closed (fixed)

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