ECM embedding language when it shouldn't - sitecore

Sitecore 6.6 rev 130214. ECM 2.0 rev. 130123
I'm encountering a number of 404 errors when trying to view the "Messages" and "Reports" links in the left-hand navigation of ECM. (Links like "Recently Dispatched", "Search Messages", "Messages in Progress", etc)
What I've found is that the links being generated are embedding the language. In my case, the URL generated includes "en" in the path. When this is included I get a 404 when clicking on them. When I remove the "en" from the path, the page renders normally.
Not working:
http://myserver/en/speak/EmailCampaign/Messages/RecentlyDispatched
Working:
http://myserver/speak/EmailCampaign/Messages/RecentlyDispatched
I've got "languageEmbedding" set to "never" in my web.config, but it looks like ECM/Speak may not be taking this into account.
Before I take this to support, has anyone else seen this? Feels like a bug to me.
Thanks!
Craig

I found the same problem and contacted sitecore support. They registered this as a bug and send us a hotfix, but this bug has now been fixed in ECM 2.1 rev.130529.
You can check the release notes here (ref.number 386058): http://sdn.sitecore.net/Products/ECM/ECM%202,-d-,1/Release%20Notes.aspx
regards,
Vicent

Related

Sitecore 7.2 Media Library images not working with underscore in the name

I just upgraded a client's test installation of Sitecore to 7.2 (SP1) and now, any image that has an underscore in its name is throwing a 404 error when being referenced by a page. This was actually a series of upgrades from 6.4 so it's quite possible that a config setting somewhere got missed along the way, but I don't see anything standing out at me that would cause this problem.
If I change the image name to not have an underscore, it works fine, and it also works fine if I set "Media.UseItemPaths" to false, but they would prefer it if their image URL's had the file name displayed.
Can anyone help identify what may have gone wrong?
Due to a change in Sitecore 7.1, any replacements specified in encodeNameReplacements are now also applied to media items as well as regular items in the content tree.
One option is to remove the replaceWith="_" declaration, but the likely reason this was added was to possibly replace spaces in your URLs so they do not display with %20. Removing this declaration will mean they return!
You can instead apply the fix specified in this Sitecore Knowledgebase article: Sitecore is unable to open media items when using encodeNameReplacements

How can I find out which version of Zurb Foundation I'm running

Is there something I can enter in the command line to find out which version I'm running?
Without knowing more about your exact situation, the easiest way is to add the following JavaSscript after you initialize Foundation ($(document).foundation();).
The final product would look like this:
$(document).foundation();
$(document).ready(function(){
alert('Foundation Core Version: ' + Foundation.version);
alert('Foundation DropDown Version:' + Foundation.libs.dropdown.version);
});
The first alert gives you the core version of foundation you are running in foundation.js and foundation.min.js.
If you are not using foundation.min.js, which loads Foundation Core and all JavaScript plugins such as: accordion, dropdown, joyride, tab, and so on, you can use the second alert. It will give you the version of the specified plugin.
You can visit the Foundation Docs on JavaScript Setup to learn more about foundation.min.js and the plugins such as: foundation.accordion.js, foundation.dropdown.js, foundation.joyride.js, foundation.tab.js and so on.
I have only tested the JavaScript on Foundation 5.0.3, but I believe it will work on older versions.
I hope that helps.
search in foundation.js for "version"
window.Foundation = {
name : 'Foundation',
version : '5.3.1',
In your browser's dev tool's console, type "Foundation.version"
For anyone looking at an easy way to do this:
To look up a project's foundation version, look into /bower_components/foundation/bower.json
it should have something similar to:
"homepage": "https://github.com/zurb/bower-foundation", "_release": "5.2.1",
As far as I'm aware there isn't something you can type in to check the version, you can type 'foundation version' but this will likely come back with 1.0.4 which I think is the installer or compass version, it isn't the version of Foundation.
In the foundation.js file, search for 'version'.

Sitecore: Detect user in Page Editor mode

Can I know how to detect user is in page editor mode using code?
This is because, I have a component, when user browses from page editor, it will search in master_index folder instead of web_index folder.
Please check with : if (Sitecore.Context.PageMode.IsPageEditorEditing)
also is working on Sitecore 6.6, it not depends on Sitecore 7.
Please check also this Sitecore blog post by Martina Welander.
To check if is normal page use: if (Sitecore.Context.PageMode.IsNormal)
To check if is preview mode use: if (Sitecore.Context.PageMode.IsPreview)
Also are others PageMode:
IsPageEditorClassic
IsPageEditorDesigning
IsPageEditorEditing
IsPageEditorNavigating, etc
If you are curious you can check with Reflector or dotPeek this class: Sitecore.Context.PageMode from Sitecore.Kernel assembly.
Rather than checking the page mode, I think you just want to piggyback on the context database name -
var indexName = Sitecore.Context.Database.Name + "_index";
I am using this syntax in view to add a class for JS detection, same code can be used for back-end detection with bit modification:
<html class="#(Sitecore.Context.PageMode.IsPageEditor ? "inexpeditor" : "notexpeditor")">

Sitecore Workbox Generating Odd Error

I've run into a problem in the Wokbox that seems like a Sitecore bug. When the "Items per Page" drop down is set to anything but "All", I'm able to expand the "Draft" and "Awaiting Approval" lists in the Workflow.
But when the "Items per Page" is set to "All", I get the following error:
Exception in MyWebSite: /sitecore/shell/default.aspx?xmlcontrol=Workbox&mo=preview
Message: Operation is not valid due to the current state of the object.
StackTrace: at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)
at System.Web.HttpRequest.FillInFormCollection()
And at this point, I'm "stuck" - and unable to revert my view back to anything less than "All" in the "Items per Page" drop-down. So, because I cannot revert back, I cannot do anything on the page, and any attempt to expand the Workflow lists (or do anything on the page) generates the above error.
Any thoughts on what is happening and how to fix this?
I followed up on this to keep from leaving this question unanswered. It turns out that this issue was related to another known issue. For the benefit of those who might be getting a similar issue, here's what fixed this:
The problem can occur when Sitecore CMS is installed on systems that have Microsoft security update MS11-100 installed.
Please refer to the similar known issue on SDN:
The Template Builder may fail when saving templates with many fields
The solution:
Try to add the following node to the section of the web.config file:
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />

How to get multiple language sites set up in Sitecore?

I am just starting to add support for multiple languages on my site... having a spot of trouble. Here are the steps I've taken so far:
In Control Panel -> Globalization, added a new language (German)
Added a new <site> definition in Web.config with hostName="localGerman.com" and language="de". Also added an alias in my hosts file for localgerman.com to point to localhost and added the host header in IIS.
Went to an item in my tree and added a new version for German. Published whole site.
Now, the host/site setup seems to work OK. When to go to http://localgerman.com/ I get my home page, with lots of missing data... there is no German version... so seems to be using the correct language.
However... when I go to the item I've added a German version of, I still get blank data. In the debugger, I can see that Sitecore.Context.Item is the German version... but all the fields are blank. Item["Content"] returns an empty string. If I manually set the language to "en" on the URL (http://localgerman.com/myitem.aspx?sc_lang=en), then I get the English version with data.
What am I missing here?
Also... when loading the German home page... my menu is blank. Presumably because the items which generate this content do not have German versions. I was under the assumption that when a language-specific version for a given item could not be loaded, then the default language version is used? But this does not seem to be the case. Am I wrong?
OK, looks like I just had the language code wrong. Setting the site language to "de-DE" instead of just "de" worked.
This is a little confusing because the default sites use language="en" instead of en-US.
You added a German version of an item, but did you fill in the fields in German ? Any localizable fields (non-shared) will be empty by default when a new version is created. It sounds like you did the other parts correctly.
The menu being blank is expected: When you try to get an language version of an item that doesn't exist, Sitecore will return null.