I have a page with multiple components in one placeholder, different component types and also multiples of the same type. There are 3 components in a particular order on the page. It was deemed desirable to change the order. Selecting the component allows moving the component and it would appear to work correctly, until hitting Save, then it disappears. This is very similar to this SO posting from a while back here. I haven't found anything indicating this bug has been fixed. For reference I am using Sitecore 7.1 (rev.140324).
After this, an attempt to add a component of the same type to the page does not work either. After resetting the page to the initial state via presentation details it was apparent that adding a component to the placeholder was having issues to begin with. Right now the workaround is manipulating the page via presentation details, which isn't so helpful for content editors. The workaround entails entering the placeholder explicitly in the field, and nested where applicable, for all components on the page.
The Sitecore logs are not showing anything. The browser console shows "Cannot parse command parameters" twice after moving the component. The associated javascript:
this.parseCommandClick = function(commandClick) {
var msg = commandClick;
var commandParams = null;
var idx1 = commandClick.indexOf("(");
var idx2 = commandClick.indexOf(")");
if (idx1 >= 0 && idx2 > idx1) {
msg = commandClick.substring(0, idx1);
try {
commandParams = $sc.evalJSON(commandClick.substring(idx1 + 1, idx2));
}
catch (e) {
console.log("Cannot parse command parameters");
}
}
return { message: msg, params : commandParams};
When the presentation details are set in the standard values for the page, the placeholder is not specified for some components and not nested for others. The issue can be replicated elsewhere by removing the specific placeholder of added components then moving them and saving. This causes the component to become deleted. I'm not sure the console logs directly relate to this.
I am trying to figure out why this could be happening.
It appears that it was how Sitecore works by default after all (as of 7.1), and not an issue with modifications and configuration. After a fresh instance was created, I was able to recreate the issue by adding components to the page via presentation details in the standard values. The issue arises from leaving the placeholder field empty. If this is the case then adding a component to the page gives the message: "An Error Occurred" and moving components often leads to deletion. So the fix for this is to change the standard values on all the effected items. It would appear there are interesting things happening when Sitecore is handling the empty fields. This is the approach I used to get around the issue.
Sitecore support replied with an additional workaround to avoid data loss:
LayoutDefinition.js