Curl plugin rewrites field names on save

Kinaski 17 Jun, 2009
Hi

I tried to setup the curl plugin with my form and submit it to salesforce webtolead url. I get to the point where I have to change some fields values in the curl parameters.

The problem is that whenever I save the Curl params it rewrites certain fields on its own. Please check the attachment.

For example, I have an email input field and it should stay the same in curl "email" but when I save it it gets rewritten to "E-Mail". Similar with my description field. I should stay description, but it gets rewritten to Description, and I don't get submissions for those fields in Salesforce.

CF version: ChronoForms_V3.1_RC5.1

Any ideas why is this happening?

Thanks,

Z
GreyHead 17 Jun, 2009
Hi kinaski,

There's a bug in the Plugin Helper file :-(

Please see the fix below, the file is administrator/components/com_chronocontact/helpers/plugin.php

The plugin helper wrongly passes saved values to the Joomla Language handler.

The Plugin loads field names incorrectly when they are also language ids e.g. id -> ID, email -> Email, password -> Password, etc.

Fixed version of the function is:

        function createInput($name, $value='', $attributes=array(), $id=false, $addTD=true, $attribTD=array() )
        {
            // create an id from $name if not supplied
            $id = ChronoContactHelperPlugin::createId($name, $id);

            $return = "<input type='text' name='$name' id='$id' ".JArrayHelper::toString($attributes)."
               value='".htmlspecialchars($value, ENT_QUOTES)."' />
             ";
            if ( $addTD ) {
                $return = ChronoContactHelperPlugin::wrapTD($return, $attribTD);
            }
            return $return;
        }
The value line was
    value='".JText::_(htmlspecialchars($value, ENT_QUOTES))."' />


Bob
Kinaski 17 Jun, 2009
Thanks Bob!

I was so close to throwing my comp through the window this morning🙂

This fix worked just fine. Thank you so much!

Regards,

Z
This topic is locked and no more replies can be posted.