Reputation: 1554
The Scenario Sitecore 8 site, we have a component called Related Video Panel that has one field for the title, and a placeholder that allows the editor to drop onto it Related Video components using the experience editor.
Related Video Panel and Related Video are both MVC controller renderings populated via GlassMapper.
The Issue - Steps to recreate (all via Experience Editor)
Following step 7, I expected a blank Related Video Panel, but instead we are presented a Related Videos Panel with Related Videos already added to it.
Troubleshooting thus far I tested that the panel was new by adding a title each time I dropped it on the page. The title is fresh every time, so I know it's showing a fresh panel, even when the renderings are incorrectly showing up.
I've also verified that the presentation details on the new tab panel are empty, so so there's no renderings explicitly set on the item's presentation details that would make them show up.
I verified that it must be related to the specific placeholder because if I follow the steps above on a different placeholder on the same page, I get the blank panel as expected.
Summary This does seem like it could be a Sitecore bug, though I hesitate to go there without further investigation/discussion. There may be something else in my configuration messing this up. I'm stumped and I'm not sure what else to investigate. I might open a ticket with Sitecore as well. Does anyone have any experience with such an issue?
Upvotes: 1
Views: 874
Reputation: 16990
The problem you have described is standard behaviour in Sitecore unfortunately. When you remove a control which defines the placeholder, the components placed within those placeholders are not removed but instead are left orphaned. You can confirm this by looking at the Presentation Details and you can verify that those nested rendering are still listed. When you add the Panel with the placeholder again the existing renderings reappear since they are still bound to that placeholder key.
You would have to write some custom code, hooking into item:saving
and then checking the Layout/Final Layout field for the any orphaned renderings and then removing them.
Upvotes: 2