I recently had a problem in which I tried to "get" items from Sitecore using TDS. The item I was trying to get had several immediate children; however, the get only fetched the top item. When I right-clicked it to try to delete, no context menu appeared. I checked the file system and found that the .item file did not physically exist, so I reloaded the Visual Studio solution. This removed the item from the Solution Explorer, but did not explain what had gone wrong.
I eventually discovered the issue was due to having an alias item of the same name at the same level in Sitecore. Once I'd renamed the alias, I could correctly get the item and all of its children.
Tuesday, 9 July 2013
Thursday, 24 May 2012
Using the jQuery Equivalent of Body OnLoad
Prior to jQuery, the way to get JavaScript to fire on loading a page was to add an onload attribute to the body HTML tag:
<body onload="mycode();">
In jQuery, this can be replaced by:
<script type="text/javascript">$(mycode);</script>
The important thing is not to include the method brackets. $(mycode()); will not work.
<body onload="mycode();">
In jQuery, this can be replaced by:
<script type="text/javascript">$(mycode);</script>
The important thing is not to include the method brackets. $(mycode()); will not work.
Labels:
HTML,
JavaScript,
jQuery
Wednesday, 13 July 2011
Lucene: Compression support not configured
I got this error when trying to extract Hits.Doc from Lucene:
Compression support not configured
at SupportClass.CompressionSupport.CheckCompressionSupport()
at SupportClass.CompressionSupport.Uncompress(Byte[] input)
at Lucene.Net.Index.FieldsReader.Uncompress(Byte[] input)
at Lucene.Net.Index.FieldsReader.AddField(Document doc, FieldInfo fi, Boolean binary, Boolean compressed, Boolean tokenize)
at Lucene.Net.Index.FieldsReader.Doc(Int32 n, FieldSelector fieldSelector)
at Lucene.Net.Index.SegmentReader.Document(Int32 n, FieldSelector fieldSelector)
at Lucene.Net.Index.IndexReader.Document(Int32 n)
at Lucene.Net.Search.IndexSearcher.Doc(Int32 i)
at Lucene.Net.Search.Hits.Doc(Int32 n)
The solution was to add the following missing keys into Sitecore AppSettings.config:
<add key="Lucene.Net.FSDirectory.class" value="Sitecore.Data.Indexing.FSDirectory, Sitecore.Kernel" />
<add key="Lucene.Net.CompressionLib.class" value="Sitecore.IO.Compression, Sitecore.Kernel" />
Compression support not configured
at SupportClass.CompressionSupport.CheckCompressionSupport()
at SupportClass.CompressionSupport.Uncompress(Byte[] input)
at Lucene.Net.Index.FieldsReader.Uncompress(Byte[] input)
at Lucene.Net.Index.FieldsReader.AddField(Document doc, FieldInfo fi, Boolean binary, Boolean compressed, Boolean tokenize)
at Lucene.Net.Index.FieldsReader.Doc(Int32 n, FieldSelector fieldSelector)
at Lucene.Net.Index.SegmentReader.Document(Int32 n, FieldSelector fieldSelector)
at Lucene.Net.Index.IndexReader.Document(Int32 n)
at Lucene.Net.Search.IndexSearcher.Doc(Int32 i)
at Lucene.Net.Search.Hits.Doc(Int32 n)
The solution was to add the following missing keys into Sitecore AppSettings.config:
<add key="Lucene.Net.FSDirectory.class" value="Sitecore.Data.Indexing.FSDirectory, Sitecore.Kernel" />
<add key="Lucene.Net.CompressionLib.class" value="Sitecore.IO.Compression, Sitecore.Kernel" />
Labels:
.NET,
C#,
Lucene,
Sitecore,
Troubleshooting
Tuesday, 17 May 2011
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
I get this error from time to time when editing plain text files in Visual Studio. I tried correcting it by going to File, Save As, Save with Encoding (in the Save dropdown). This seemed to do the trick about 50% of the time. However, it would seem this was just coincidence. Latest findings suggest it is a Firefox cache problem. I tried the same URL in another browser and it worked. Fingers crossed this is a fix.
Labels:
Troubleshooting,
Visual Studio
Friday, 14 January 2011
Non white space characters cannot be added to content.
When trying to initialise an XDocument with a string containing XML, I kept getting the error:
Unhandled Exception: System.ArgumentException: Non white space characters cannot be added to content.
With help from a colleague, and recalling how I'd got around this error previously, the solution is to use the static XDocument.Parse( string ) method. Eg:
var myXDoc = XDocument.Parse( xmlString );
Unhandled Exception: System.ArgumentException: Non white space characters cannot be added to content.
With help from a colleague, and recalling how I'd got around this error previously, the solution is to use the static XDocument.Parse( string ) method. Eg:
var myXDoc = XDocument.Parse( xmlString );
Labels:
.NET,
Troubleshooting,
Xml
Wednesday, 1 December 2010
SOAP header Security was not understood
XML Web services seem to be declining in use, so finding information on this SoapHeaderException proved to be a bit difficult. I added in <soapextensionimportertypes> and installed WSE 3.0, but it made no difference. What worked for me was adding the following line to my code:
[Edit 9 Dec 2010]
Actually, this was a red herring. It worked by adding a "service reference", rather than a old-fashioned "web reference".
webService.SoapVersion =
System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
[Edit 9 Dec 2010]
Actually, this was a red herring. It worked by adding a "service reference", rather than a old-fashioned "web reference".
Labels:
ASP.NET,
Troubleshooting,
XML Web services
Wednesday, 18 August 2010
Using Sitecore with Firefox, Chrome and other browsers
Sitecore recommends the use of IE for its client. When trying to log in with Firefox or Chrome (and presumably others), you don't get the option of viewing the desktop. There is a way you can override this behaviour. Open Sitecore in IE and go to the User Manager. Select your account and click Edit to bring up the "Edit User" dialogue. Click on the Profile tab and set the start URL to "Desktop". Save your changes and then try logging in with Firefox, etc. You should now see the full desktop.
Subscribe to:
Posts (Atom)