hhuijser/liferay-portal — pull request #1618 by jonathanmccann (2013-12-06 16:43:51+00:00)
Title: LPS-42524

Hey Hugo,

This is a fix for the issue we were talking about the other day. I'm not 100% sure on it, but this seems to be the place to resolve the issue. What is happening is that when the layout is getting accessed it runs through this invocation method which in turns tries to merge the layout with the layout template. Since the page no longer exists in the layout template, the NoSuchLayoutException is thrown. My fix is to check and see if the layout is mergeable and if not then do not merge the template. I only added it to the "getLayout" one and not the "getLayouts" because "getLayouts" calls "mergeLayoutSetPrototypeLayouts" which in turn calls "SitesUtil.isLayoutSetMergeable".

Let me know if you have any questions or if you don't think this is the right place to make the fix. Thanks.