Sitecore / Sitecore.Rocks

Sitecore Rocks is a plugin for Visual Studio for Sitecore developers.
Other
75 stars 27 forks source link

Rocks does not set uid for personalization rules #135

Open nickwesselman opened 4 years ago

nickwesselman commented 4 years ago

In rocks:

  1. create sample item
  2. personalize sample rendering (any rule any action)
  3. save

In sitecore content editor:

  1. navigate to item from step 1
  2. open presentation details
  3. select sample rendering and click personalize

Result: exception:

[FormatException: Unrecognized Guid format.]
   System.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException) +4055268
   System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result) +149
   System.Guid..ctor(String g) +137
   Sitecore.Data.ShortID..ctor(String id) +63
   Sitecore.Data.ShortID.Parse(String value) +59
Sitecore.Shell.Applications.WebEdit.Dialogs.Personalization.PersonalizationForm.GetRuleSectionHtml(XElement rule) +150
   Sitecore.Shell.Applications.WebEdit.Dialogs.Personalization.PersonalizationForm.RenderRules() +298

In newer Sitecore, I see the exception:

[NullReferenceException: Object reference not set to an instance of an object.]
   Sitecore.Shell.Applications.Layouts.DeviceEditor.<>c.<HasRenderingRules>b__84_0(XElement rule) +47
   System.Linq.WhereEnumerableIterator`1.MoveNext() +204
Sitecore.Shell.Applications.Layouts.DeviceEditor.DeviceEditorForm.HasRenderingRules(RenderingDefinition definition) +278
Sitecore.Shell.Applications.Layouts.DeviceEditor.DeviceEditorForm.UpdateRenderingsCommandsState() +261

Expected result: no error editor is open. Rule configured in rocks is visible.

Notes: Rocks produces the following xml for rules:

uid attribute is missing for the rule node.