Bug with Feedback Form variables

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
chilsta
Forum Members
Forum Members
Posts: 52
Joined: Thu Oct 20, 2005 8:22 pm

Bug with Feedback Form variables

Post by chilsta »

Client wants this on the front end:

Address 1: [ form field ]
Address 2: [ form field ]
Address 3: [ form field ]

But when I go to view the variables in the "*Email Results to set Address(es)" field editor, it shows all of the Addresses as the same variable:

$address Field: Address line 1:
$address Field: Address line 2:
$address Field: Address line 3:

The email sent uses the same data (from the "Address line 1" field) for all 3 fields.

I got around this by changing the fieldnames, but thought I'd flag this in case it helps with the dev of the new Feedback Form module, or others having the same problem.

Cheers,

C*
niq

Re: Bug with Feedback Form variables

Post by niq »

I found the same problem. I found a sort-of fix around (without needing to change the field names). I edited the MakeVar function in the DispositionEmailBase.class.php file (line 59) changing the length of the variable names 40 characters.

Code: Select all

function MakeVar($string)
	{
		$string = strtolower(preg_replace('/\s+/','_',$string));
		$string = preg_replace('/\W/','',$string);
		if (strlen($string) > 40)
			{
			$string = substr($string,0,40);
			$pos = strrpos($string,'_');
			if ($pos !== false)
				{
				$string = substr($string,0,$pos);
				}
			}
		return $string;
	}
I found this worked for most of the form fields I changed, but I still get a problem with any variable name that begins the same way. The following 2 fields return the same value for example: 'Surname M' and 'Surname F'. A fix would be great.
Post Reply

Return to “CMSMS Core”