mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 20:13:52 +08:00
#19107: Fixing layout placement cached issue
Work Item: 19107 --HG-- branch : 1.x
This commit is contained in:
@@ -73,19 +73,22 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
newShapeMetadata.Wrappers.Add(wrapper);
|
||||
}
|
||||
|
||||
// copy the current location for further processing
|
||||
var localPlacement = placement.Location;
|
||||
|
||||
// the zone name is in reference of Layout, e.g. /AsideSecond
|
||||
if (placement.Location.StartsWith("/")) {
|
||||
placement.Location = placement.Location.Substring(1);
|
||||
localPlacement = placement.Location.Substring(1);
|
||||
parentShape = context.Layout;
|
||||
}
|
||||
|
||||
var delimiterIndex = placement.Location.IndexOf(':');
|
||||
var delimiterIndex = localPlacement.IndexOf(':');
|
||||
if (delimiterIndex < 0) {
|
||||
parentShape.Zones[placement.Location].Add(newShape);
|
||||
parentShape.Zones[localPlacement].Add(newShape);
|
||||
}
|
||||
else {
|
||||
var zoneName = placement.Location.Substring(0, delimiterIndex);
|
||||
var position = placement.Location.Substring(delimiterIndex + 1);
|
||||
var zoneName = localPlacement.Substring(0, delimiterIndex);
|
||||
var position = localPlacement.Substring(delimiterIndex + 1);
|
||||
parentShape.Zones[zoneName].Add(newShape, position);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user