[SalesForce] “FeedItem-Feed Item Layout” preventing profile deployment

Googled my problem and found the exact problem but with no answers.

After the upgrade to Winter '15 / Package.xml to 30.0, there are errors on my profiles Error: profiles/PROFILENAME.profile(12101,24):In field: layout - no Layout named FeedItem-Feed Item Layout found.

So I added the layout to my package.xml and project, and now I have a new error Error: layouts/FeedItem-Feed Item Layout.layout(FeedItem-Feed Item Layout):Layout must have at least 1 section

I have not been able to locate anywhere in the browser UI that this specific layout can be configured. The only option I see is to get rid of the layout from my project/package, refresh profiles from Salesforce server, delete the below-mentioned few lines of XMLs from each profile XML file and then deploy.

<layoutAssignments>
    <layout>FeedItem-Feed Item Layout</layout>
</layoutAssignments>

Am I the only one facing this problem? Isn't there any way I can simply refresh the profiles and deploy without interfering with the XMLs?

Best Answer

Occasionally, you'll run into issues like this with the Ant Migration Toolkit. It's really tedious, but the easiest way I have found is to manually modify the profile's metadata (perhaps multiple profiles) to remove the FeedItemLayout and any other layouts that may be problematic.

The tedious part comes in if you do any sort of refreshes of the profiles from a source org (like a development org or sandbox), when your profile changes are overwritten and you have to redo the FeedItemLayout fix.

If you haven't already, I strongly suggest you back up your work into a SCM like bitbucket, so that you can track each of these metadata changes you're making.