Created
February 14, 2012 14:28
-
-
Save nshaw/1827086 to your computer and use it in GitHub Desktop.
staging-errors-after-upgrade-from51.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/portal-impl/src/com/liferay/portal/lar/LayoutImporter.java b/portal-impl/src/com/liferay/portal/lar/LayoutImporter.java | |
index 21a05e0..a4b576f 100644 | |
--- a/portal-impl/src/com/liferay/portal/lar/LayoutImporter.java | |
+++ b/portal-impl/src/com/liferay/portal/lar/LayoutImporter.java | |
@@ -970,7 +970,6 @@ public class LayoutImporter { | |
groupId, privateLayout); | |
} | |
else { | |
- importedLayout.setUuid(layout.getUuid()); | |
importedLayout.setLayoutPrototypeUuid( | |
layout.getLayoutPrototypeUuid()); | |
importedLayout.setLayoutPrototypeLinkEnabled( | |
@@ -1039,11 +1038,25 @@ public class LayoutImporter { | |
parentLayoutId = parentLayout.getLayoutId(); | |
} | |
else if (Validator.isNotNull(parentLayoutUuid)) { | |
+ | |
+ // After upgrading from versions of the portal before uuid matching | |
+ // was introduced, resolving the parentLayout may have to fall back | |
+ // to layoutId match | |
+ | |
Layout parentLayout = | |
- LayoutLocalServiceUtil.getLayoutByUuidAndGroupId( | |
+ LayoutLocalServiceUtil.fetchLayoutByUuidAndGroupId( | |
parentLayoutUuid, groupId); | |
- parentLayoutId = parentLayout.getLayoutId(); | |
+ if ((parentLayout == null) && | |
+ (parentLayoutId != LayoutConstants.DEFAULT_PARENT_LAYOUT_ID)) { | |
+ | |
+ parentLayout = LayoutUtil.fetchByG_P_L( | |
+ groupId, privateLayout, parentLayoutId); | |
+ } | |
+ | |
+ if (parentLayout != null) { | |
+ parentLayoutId = parentLayout.getLayoutId(); | |
+ } | |
} | |
if (_log.isDebugEnabled()) { | |
@@ -1052,6 +1065,12 @@ public class LayoutImporter { | |
" and parent layout id " + parentLayoutId); | |
} | |
+ // The existing layout may have been resolved other than by uuid, so | |
+ // make sure to always update the uuid so that later resolutions are | |
+ // simplified | |
+ | |
+ importedLayout.setUuid(layout.getUuid()); | |
+ | |
importedLayout.setCompanyId(user.getCompanyId()); | |
importedLayout.setParentLayoutId(parentLayoutId); | |
importedLayout.setName(layout.getName()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment