Dieses Blog durchsuchen

Donnerstag, 26. September 2013

Sitecore 7: Troubleshooting: startIndex cannot be larger than length of string.

Problem:

I stepped i to this error while creating a Package in sitecore. I selected only a big subtree of Database items and no files.

Server Error in '/' Application.

startIndex cannot be larger than length of string.
Parameter name: startIndex

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   System.String.Substring(Int32 startIndex) +19
   Sitecore.Install.Items.ItemFieldsProperties.GetFieldsProperties(Item item) +432
   Sitecore.Install.Items.ItemToEntryConverter.InternalConvert(Item item, IProcessingContext context)
   Sitecore.Install.Framework.BaseConverter`1.Convert(T entry, IProcessingContext context) +69
   Sitecore.Install.Framework.InternalSink.Put(T entry) +97
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +104
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Framework.BaseSource`1.Populate(ISink`1 sink) +705
   Sitecore.Install.Framework.SourceCollection`1.Populate(ISink`1 sink) +166
   Sitecore.Install.Utils.EntrySorter.Populate(ISink`1 sink) +87
   Sitecore.Shell.Applications.Install.Dialogs.AddStaticItemSourceDialog.EndWizard() +770




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044

WORK AROUND:

If I choose a tree with many subitems so may the start index gets too large.  My solution was to choose smaller tree parts. Anyway a nicer message should appear in Sitecore 6.6 update 6 version.

Feedback Sitecore Support:

Hello,
I’m still unable to reproduce the issue at my side even with large database.
So it looks like something specific to your solution.
I suggest you to divide your data into several packages.
If you require deeper investigation, please upload your entire master database at our pubic FTP.

Note:

Always use firefox browser while installing or creating items from "package" or "serialization" because Internet Explorer gets time-out issue while installing a big package. 



Sitecore Training: Round-Robin Questions and Review for Module 2

Here are the very basic Sitecore questions with answers:

1. What is an item?
An item is an addressable unit of content.


2. How are an item’s fields defined? In other words, what defines an item?
Data templates define items with fields and field types.


3. What are the advantages of template inheritance?
The advantages of template inheritance are numerous: developers create complex content types by
inheriting from base data templates; standardized fields across data templates lets developers easily
create presentation components; and allows business users see normalized field names and field
types for content they create and edit. In addition, if not overridden, template standard values are
inherited, allowing developers to easily describe default values for fields as well as define default
settings such as insert options and layout details.


4. What is the name of the data template that ALL data templates inherit from?
Standard Template


5. Where are default values set?
Template Standard Values known also as the __Standard Values item.


6. Give an example of when you would use a default value?
There are two type of default values: Dynamic and Static. Dynamic values are tokens, like $name,
$date, and $id. This values are defined when an item is created (when the object has been
instantiated). Static values are hard coded, such as a default value for database field. A good
example for when to use a dynamic default value (like $name) is when you want to capture the item
name into a given field such as a Menu Title field. For a checkbox field named Required, a good
default value might be 1, which means checked.


7. What are Insert Options?
Insert options allow business users to create child items. There are three types of insert options:
data templates, branch templates or command templates. It is possible to override the behaviour
defined insert options using Insert Rules and/or the modifying the <uiGetMasters  pipeline.


8. What’s a best practice for defining insert options?
As a best practice, developers should define insert options on the __Standard Values item of the
given data template.