Results 1 to 2 of 2

Thread: [solved] FormAuto bug in confirmation mail template

  1. #1
    New user
    Join Date
    05-03-10.
    Posts
    8

    Default [solved] FormAuto bug in confirmation mail template

    Hello.

    There seems to be a bug in FormAuto.php between lines 1253 and 1272. The problem lies with the form field replacement in the email template in case of a 'select' field. The value that is inserted in the mail is only the label of the select field and not the value. Moving the select case on line 1256 to 1292 fixes the problem, but I assume this eliminates the option of having multiple values from one select field.

    In addition on line 1263 there seems to be a whitespace between 'array' and the opening parenthesis.

    Thank you for an otherwise great module!!

    Regards

    Jesper.

    Code:
    			switch ($field['type'])
    			{
    				case 'checkbox':
    				case 'select':
    				case 'radio':
    				
    					$i = 0;
    					$value = '';
    					$options = deserialize($field['options']);
    					$values = is_array($arrValues[$key]) ? deserialize($arrValues[$key]) : 										
    									array ($arrValues[$key]);
    
    					foreach ($options as $id=>$option)
    					{
    						if (in_array($option['value'], $values)) {
    							$value .= ($i>0 ? ', ' : '') . $option['label']; 
    							$i++;
    						}																	
    					}
    					break;

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: FormAuto bug in confirmation mail template [solved]

    Note this is not a bug. This is just a function. When you have defined things like this:

    Venue [select]
    options: [cpt] Cape Town, [jhb], Johannesburg, [dbn] Durban

    When I send out the confirmation e-mail to the registration client, I don't want then to receive the "value" as it might be a meaningless code and the client only ever saw the label, so we send them the confirmation label as well. That makes sense.

    If you want the actual data from the database, then you have to login and export the data of the registrations. The sending of data 1 by 1 on e-mail to an administrator, defeats the purpose of the FormAuto module. There is both a FE and BE module to show the raw data.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •