8

I've got a vanilla instance of Sitecore 8.2 installed on my sandbox and I'm getting this error (taken from the logs):

Exception: Sitecore.Exceptions.InvalidItemNameException Message: An item name lenght should be less or equal to 100. Source: Sitecore.Kernel at Sitecore.Data.Items.ItemUtil.AssertItemName(Item destinationItem, String name) at Sitecore.Data.Items.Item.set_Name(String value) at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version) at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context, Boolean removeOtherVersions) at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)

What config setting do I need to change in order to get past this error?

2 Answers 2

12

The correct way to resolve this would be to fix the cause of the issue and reduce the item length to less than 100 on the problematic item.

As you have also found, you can increase the MaxItemNameLength to a higher number to get around the issue.

Be aware though, the Name field in the Items table in the database has a data type of nvarchar(256) so setting this value to more than 256 may cause you issues.

I would also recommend you revert this setting back to 100 (by deleting your patch config) after installing your content package since this directly affects your URLs and your content editors may therefore be able to create very long item names. Again, I highly recommend you identify the problematic item and reduce the item length to not cause issues in the future.

1
  • 1
    Those are good things to note. Especially understanding that the table only holds 256 characters. Commented Oct 4, 2016 at 17:38
6

In Sitecore.config file, you need to find this item:

<!--  MAX ITEM NAME
        Specifies the maximum length of an item name.
        Default value: 100
  -->
<setting name="MaxItemNameLength" value="100" />

Change the value here to be something bigger, maybe like "1000".

I would do this in a patch file, though, and not directly in the sitecore.config file, as doing this in a patch file makes upgrading in the future much easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.