Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package installation fails: Sitecore.PowerShell.Extensions-5.1.zip #1140

Closed
bohessner opened this issue Sep 24, 2019 · 10 comments
Closed

Package installation fails: Sitecore.PowerShell.Extensions-5.1.zip #1140

bohessner opened this issue Sep 24, 2019 · 10 comments
Labels
question Need help solving a problem.
Milestone

Comments

@bohessner
Copy link

bohessner commented Sep 24, 2019

Expected Behavior

Sitecore.PowerShell.Extensions-5.1.zip will install

Actual Behavior

"An item name cannot start or end with a space"

Node:
"items/core/sitecore/system/Dictionary/PowerShell/T/The data for the dialog is not available Either your server was restarted or the server cache was /{90A4B70F-D65F-477F-A3B0-CF580530DD68}/en/1/xml"

After "was" is a whitespace.

I have tried to set:

setting name="InvalidItemNameChars" value=""
setting name="ItemNameValidation" value="[\s\S]+"
setting name="MaxItemNameLength" value="1000"

Steps to Reproduce the Problem

Sitecore.NET 8.1 (rev. 151207)

Installed:
Sitecore.PowerShell.Extensions-5.0.zip

@michaellwest
Copy link
Member

Have you tested by restoring the values to the default settings?

@michaellwest michaellwest added the question Need help solving a problem. label Sep 24, 2019
@michaellwest michaellwest added this to the User Support milestone Sep 24, 2019
@bohessner
Copy link
Author

I have restored the values to default settings:

setting name="InvalidItemNameChars" value="/:?"<>|[]"
setting name="ItemNameValidation" value="^[\w*$][\w\s-$]*((\d{1,})){0,1}$"
setting name="MaxItemNameLength" value="100"

The installation error:

"ERROR Installation failed: Sitecore.Exceptions.InvalidItemNameException: Et elementnavn skal passe til mønstret: ^[\w*$][\w\s-$]*((\d{1,})){0,1}$ (styres af indstillingen ItemNameValidation)"

When I change ItemNameValidation to accept anything the next error will be: MaxItemNameLength (the item is 100+)

I set MaxItemNameLength to 1000, and "An item name cannot start or end with a space" error will kick in - like in the initial post.

@bohessner
Copy link
Author

Hi

Decompiled sitecore and found:

public static string GetItemNameError(string name)
{
Sitecore.Diagnostics.Error.AssertString(name, nameof (name), true);
if (name.Length == 0)
return Translate.Text("An item name cannot be blank.");
if (name[name.Length - 1] == '.')
return Translate.Text("An item name cannot end in a period (.)");
if (name.Length != name.Trim().Length)
return Translate.Text("An item name cannot start or end with blanks.");

if (name.IndexOfAny(Settings.InvalidItemNameChars) >= 0)
return string.Format(Translate.Text("An item name cannot contain any of the following characters: {0} (controlled by the setting InvalidItemNameChars)"), (object) new string(Settings.InvalidItemNameChars));
string itemNameValidation = Settings.ItemNameValidation;
if (itemNameValidation.Length > 0 && !Regex.IsMatch(name, itemNameValidation, RegexOptions.ECMAScript))
return string.Format(Translate.Text("An item name must satisfy the pattern: {0} (controlled by the setting ItemNameValidation)"), (object) itemNameValidation);
return string.Empty;
}

How do I get around this?

@michaellwest
Copy link
Member

I'll have a look at the newer versions of Sitecore to see if this issue exists. Thank you for reporting it.

@bohessner
Copy link
Author

Ok, I found a solution:

Opened Sitecore.PowerShell.Extensions-5.1.zip in 7-Zip and made changes inside the package.

Removed traling blank from this node:
\items\core\sitecore\system\Dictionary\PowerShell\T\The data for the dialog is not available Either your server was restarted or the server cache was

Opened the xml file and removed traling blank in both references:
\items\core\sitecore\system\Dictionary\PowerShell\T\The data for the dialog is not available Either your server was restarted or the server cache was{90A4B70F-D65F-477F-A3B0-CF580530DD68}\en\1\xml

@michaellwest
Copy link
Member

I think that is the only item. Nice find.

@telltomithun
Copy link

Hi Michael, Could you share me the link which has the updated/fixed powershell zip file

@michaellwest
Copy link
Member

Installing 6.1.1 would resolve the issue.

@ShilpySHU
Copy link

Getting same error when trying to install SXA on Vanilla Sitecore 9.3 on local machine.
[Sitecore PowerShell Extension for Sitecore 9.3]
Package for Sitecore PowerShell Extension 6.0 for Sitecore 9.3.

Message:
The installation failed.

An item name cannot start or end with blanks.

@michaellwest
Copy link
Member

The solution can be found in the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Need help solving a problem.
Projects
None yet
Development

No branches or pull requests

4 participants