Download & Extend

Change name of sender field to allow better theming

Project:ecard
Version:6.x-1.6
Component:Code
Category:feature request
Priority:normal
Assigned:zetxek
Status:closed (fixed)

Issue Summary

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

#1

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.

#2

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:

<?php
 
//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:

<?php
 
//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
 
);
?>

#3

Status:needs review» fixed

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

Changed in all versions.

#4

Status:fixed» closed (fixed)

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

nobody click here