Unable to edit any rules on one SmartForm after upgrading from K2 4.7 to K2 5.1
kbt155722
PRODUCTIssue
With K2 Workdesk SmartStarter installed on K2 4.7, editing any rules on one SmartForm after upgrading to K2 5.1 returns an error:
"A control with the name 'com.K2.App.Workdesk.ItemView.Content' already exists Type: System.ArgumentException Source: SourceCode.Forms.Authoring Method Base Member Type: Method Name: EnsureUniqueControlName Module Scope Name: SourceCode.Forms.Authoring.dll Declaring Type Full Name: SourceCode.Forms.Authoring.ControlCollection Stack Trace: at SourceCode.Forms.Authoring.ControlCollection.EnsureUniqueControlName(String name) at SourceCode.Forms.Authoring.Control.set_Name(String value) at SourceCode.Forms.Utilities.Design.SmartFormsAnalyzerResolver.Visit(View instance) at SourceCode.Forms.Utilities.Design.SmartFormsAnalyzerResolver.ResolveView(Reference reference) at SourceCode.Forms.Utilities.Design.SmartFormsAnalyzerResolver.Resolve(Reference reference) at SourceCode.Forms.Utilities.Design.Analyzer.ResolveReferences(IEnumerable`1 references, HashSet`1 evaluatedReferences) at SourceCode.Forms.Utilities.Design.Analyzer.Analyze(Object target, Boolean filter, Dictionary`2 rebinds, List`1 unbinds, Boolean deepAnalyze) at SourceCode.Forms.Utilities.Design.Analyzer.ContainsErrors(Object target) at SourceCode.Forms.Utilities.Design.Analyzer.AnalyzeReferences(ReferenceCollection references) at SourceCode.Forms.Utilities.Design.Analyzer.Analyze(Object target, Boolean filter, Dictionary`2 rebinds, List`1 unbinds, Boolean deepAnalyze) at SourceCode.Forms.Utilities.RuleHelper.TransformAuthoringDefinitionToRuleDefinition(String context, String xmlDefinition, String stateID, Guid eventID, Boolean transformAll) at SourceCode.Forms.Rules.PartialPage.Page_Load(Object sender, EventArgs e)"
Symptoms
The issue is caused by a whitespace at the beginning of the control name in the [K2].[Form].[Control] table:
[ com.K2.App.Workdesk.ItemView.Content]
Troubleshooting Steps
Please apply the following steps:
1. Execute the query below to retrieve the ID of the 'com.K2.App.Workdesk.ItemView.Content' control.
Copy the ID value out to a text editor.
2. Run the query below to update the [Name], [DisplayName], and [Properties] columns to remove the whitespace:
SET Name = LTRIM(Name),
DisplayName = LTRIM(DisplayName),
Properties = '<Property>
<Name>ControlName</Name>
<Value>com.K2.App.Workdesk.ItemView.Content</Value>
</Property>'
WHERE id='[ID from Step 1]'
Please note: http://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#Database_Reference.html