Console icon indicating copy to clipboard operation
Console copied to clipboard

Receive-file dialog errors out when invalid file name upload is attempted

Open WDrake98 opened this issue 4 years ago • 1 comments

Expected Behavior

When I attempt to upload a file with an invalid character in the file name, I should get a warning that file is invalid

Actual Behavior

An alert dialog appears that's too small to read and file is not uploaded.

Steps to Reproduce the Problem

Sitecore.PowerShell.Extensions-6.1.1 Sitecore 9.2 base install

  1. run script Receive-File -ParentItem (get-item "master:\media library\Files")
  2. select a file with parentheses in the file name. I.e., apples(1).txt
  3. select upload
  4. Error box will appear that's unreadable
  5. Errors in logs show error message
  • [x] Tested issue with clean install of Sitecore and the latest available version of SPE.

  • [ ] Asked questions on the Sitecore Slack Chat channel.

  • [ ] Reviewed questions and answers on the Sitecore Stack Exchange.

image

Error Message: 17172 10:13:22 ERROR One or more exceptions occurred while processing the subscribers to the 'item:creating' event. Exception[1]: System.ArgumentException Message[1]: 'Name' should consist only of letters, digits, dashes or underscore Source[1]: Sitecore.Marketing.Core at Sitecore.Marketing.Core.Extensions.ConditionValidatorExtensions.IsValidAlias(ConditionValidator`1 validator) at Sitecore.Marketing.xMgmt.Definitions.ItemEventHandler.ValidateItemName(ItemData itemData) at Sitecore.Marketing.xMgmt.Definitions.ItemEventHandler.OnItemCreating(Object sender, EventArgs args) at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)

17172 10:13:22 ERROR Could not save posted file: HedgehogError(1).txt Exception: System.AggregateException Message: One or more exceptions occurred while processing the subscribers to the 'item:creating' event. Source: Sitecore.Kernel ...

Nested Exception

Exception: System.ArgumentException Message: 'Name' should consist only of letters, digits, dashes or underscore Source: Sitecore.Marketing.Core at Sitecore.Marketing.Core.Extensions.ConditionValidatorExtensions.IsValidAlias(ConditionValidator`1 validator) at Sitecore.Marketing.xMgmt.Definitions.ItemEventHandler.ValidateItemName(ItemData itemData) at Sitecore.Marketing.xMgmt.Definitions.ItemEventHandler.OnItemCreating(Object sender, EventArgs args) at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)

WDrake98 avatar Jun 08 '21 15:06 WDrake98

Tested with 10.2 XM and didn't see the error. Curious why it happens for XP.

image

michaellwest avatar Mar 11 '22 04:03 michaellwest