Upgrade 7.0.2 -> 7.1: Web to lead creation failing

Existing Web to Lead form with an existing Workflow on Leads - New Record fails insert into leads_cstm and leads with duplicate entry on primary keys.

Workflow was working prior to upgrade. Workflow is supposed to run on New Record. It modifies 2 attributes and sends an email to a user.

Not sure if the Workflow is the issue, but the lead does get created. But attributes are not modified and notification emails from the Workflow are not generated.

Initial Lead Creation email from Sugar IS properly generated and sent. However Email address record is not created. So the lead is only partially finished. Consequently, I am not sure if any of the Workflow discussion is germane. Included for completeness.

This looks likely to be related to Email address creation. Email records are not created when either creating or updating Leads from within SuiteCRM. However, no error is recorded in the log. I get a blank page response in the browser.

Tue Apr 1 10:05:39 2014 [20757][ab95d954-dd2c-9aaa-222d-5238e6306f4d][FATAL] Query Failed: INSERT INTO leads_cstm (id_c ,relationship_category_c ,conference_name_c ,lead_type_c ,student_enrollment_c ,assistant_email_c ,rating_c ,jjwg_maps_lat_c ,jjwg_maps_lng_c ) VALUES (‘1779ae4d-2d7c-e18a-f991-533af125178b’ ,‘Individual_School’ ,’’ ,‘New_Business’ ,0 ,’’ ,‘Warm’ ,0 ,0 ): MySQL error 1062: Duplicate entry ‘1779ae4d-2d7c-e18a-f991-533af125178b’ for key ‘PRIMARY’
Tue Apr 1 10:05:39 2014 [20757][ab95d954-dd2c-9aaa-222d-5238e6306f4d][FATAL] Error inserting into table: leads: Query Failed: INSERT INTO leads (id,date_entered,date_modified,modified_user_id,created_by,deleted,assigned_user_id,first_name,last_name,do_not_call,phone_work,primary_address_city,primary_address_state,converted,lead_source,status,account_name,campaign_id)
VALUES (‘1779ae4d-2d7c-e18a-f991-533af125178b’,‘2014-04-01 17:05:37’,‘2014-04-01 17:05:37’,‘ab95d954-dd2c-9aaa-222d-5238e6306f4d’,‘ab95d954-dd2c-9aaa-222d-5238e6306f4d’,0,‘4e60d125-d640-bd6c-6f8f-530d4b0d59c0’,‘Another’,‘Test’,0,’’,’’,’’,0,‘Web Site’,‘New’,‘Somewheresville’,‘45da4d26-f16d-8424-ec0b-52d4f84345a6’): MySQL error 1062: Duplicate entry ‘1779ae4d-2d7c-e18a-f991-533af125178b’ for key ‘PRIMARY’

Hi Andrew,

Please see this topic for a solution.

If your actions to modify the attributes are after the email step, this may also be related to the record not being modified by workflow.

Please check and confirm.

Thanks,

Will.

The issue is definitely workflow related. Here are the steps I have taken. Matthew still has access to the system, by the way, if he would like to take a look.

  1. Added aow_email_to_list
  2. Edited Workflow to ensure To selected in drop down.
  3. Ensured Email step was the last step of the workflow - still generates described behavior.
  4. Removed Email step in the workflow entirely - still generates described behavior.
  5. Disabled workflow entirely - lead generation completes properly.
  6. Created a new Workflow with no actions acting on Leads - New Record Only - lead generation completes properly.
  7. Added a modify assigned to step to the Lead object (no additional email step added to the workflow) - lead generation fails with described behavior.

Something is amiss with the Workflow upgrade. Any ideas on how to proceed?

Thanks, Will

Hi Andrew,

There have been some updates to the topic I previously linked you to. Please revise this topic and make the appropriate changes and confirm if this resolves your issue.

Thanks,

Will.

Will,

As I mentioned, I removed all reference to email functionality in the newly created test workflow and I get the same failure mode. Good to have the bug in the email step identified and fixed, but the issue is not resolved.

To be clear, activating any workflow with an action step causes this failure mode.

Bump: This is still a significant issue. Any WorkFlow I create with any actions on New Record breaks object creation.

This is a total hack given that I don’t fully understand the codebase yet, but had to fix it given that I just got my company to commit to suitecrm before this 7.1 debacle.
in modules/AOW_Actions/actions/templateParser.php

add a continue statement in line 33 if the $field_def[‘type’] is not set.

foreach($focus->field_defs as $field_def) {
				if (!isset($field_def['type'])) {continue;}
                if($field_def['type'] == 'currency'){
                    $repl_arr[$key."_".$field_def['name']] = currency_format_number($focus->$field_def['name'],$params = array('currency_symbol' => false));
                }
				else if($field_def['type'] == 'enum' && isset($field_def['options'])) {
                    $repl_arr[$key."_".$field_def['name']] = translate($field_def['options'],$focus->module_dir,$focus->$field_def['name']);
				}
                else if($field_def['type'] == 'multienum' && isset($field_def['options'])) {
					$repl_arr[$key."_".$field_def['name']] = implode(', ', unencodeMultienum($focus->$field_def['name']));
				}
                else {
					$repl_arr[$key."_".$field_def['name']] = $focus->$field_def['name'];
				}
			} // end foreach()

This fixed the issue for me and emails are now being sent, lead creation is fine… and im hoping we can still use this…

Can I ask, are all the upgrade issues we’re experiencing “par for the course” for a project like this, or are these major issues that will require a very quick .01 update to address?

Updated software to version 7.1.1 and this issue persists. I have done a repair and all tables are up to date. Where do we stand on identifying a permanent, appropriate fix so I can reenable workflow?

I need an update on this issue ASAP. Workflows are failing with 7.1.1. What is the ETA on getting this addressed?

in ‘modules/AOW_Actions/actions/actionCreateRecord.php’ at around line 280, before

$record->save($check_notify);

try adding

$record->new_with_id = false;

That did solve this issue.

Thank you, Matt

I’ve had similar problem as “andrewl” but my action step involved with Relationship entry and this thread saves the day, thanks Matt!

This should be recorded as workflow action bug.