• Resolved 01labs

    (@01labs)


    I am receiving these errors when we receive the email notification after the user fills out the form (using fields set for “street address”, “state” and “country”):

    Notice: Undefined index: streetAddress2 in
    /home3/pch808/public_html/wp-content/plugins/smart-forms/string_renderer/rednao_address_renderer.php
    on line 11

    Notice: Undefined index: state in
    /home3/pch808/public_html/wp-content/plugins/smart-forms/string_renderer/rednao_address_renderer.php
    on line 13

    Notice: Undefined index: country in
    /home3/pch808/public_html/wp-content/plugins/smart-forms/string_renderer/rednao_address_renderer.php
    on line 15

    Please advise.
    Thank you,
    Mark

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Sorry that seems to be a bug with the plugin. I will release the fix in the next update but if you want to fix it right away please open the file \smart-forms\string_renderer\rednao_address_renderer.php and change the file content with this:

    <?php
    
    class rednao_address_renderer extends rednao_base_elements_renderer {
    
        public function GetString($formElement,$entry)
        {
            $address="";
            if(isset($entry["streetAddress1"]))
                $this->AppendAddressComponent($address,$entry["streetAddress1"]);
            if(isset($entry["streetAddress2"]))
                $this->AppendAddressComponent($address,$entry["streetAddress2"]);
            if(isset($entry["city"]))
                $this->AppendAddressComponent($address,$entry["city"]);
            if(isset($entry["state"]))
                $this->AppendAddressComponent($address,$entry["state"]);
            if(isset($entry["zip"]))
                $this->AppendAddressComponent($address,$entry["zip"]);
            if(isset($entry["country"]))
                $this->AppendAddressComponent($address,$entry["country"]);
    
            return htmlspecialchars($address);
        }
    
        public function AppendAddressComponent(&$address, $component)
        {
            if($component=="")
                return $address;
    
            if($address=="")
                $address=$component;
            else
                $address.=", ".$component;
    
            return $address;
    
        }
    
    	public function GetExValues($formElement, $entry)
    	{
    		return array(
    			"exvalue1"=>htmlspecialchars($entry["streetAddress1"]),
    			"exvalue2"=>htmlspecialchars($entry["streetAddress2"]),
    			"exvalue3"=>htmlspecialchars($entry["city"]),
    			"exvalue4"=>htmlspecialchars($entry["state"]),
    			"exvalue5"=>htmlspecialchars($entry["zip"]),
    			"exvalue6"=>htmlspecialchars($entry["country"])
    		);
    	}
    }

    Regards!

Viewing 1 replies (of 1 total)
  • The topic ‘Undefined index error’ is closed to new replies.