Skip to content

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

@WDrake98

Description

@WDrake98

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
  • 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)

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions