Skip to content

Commit

Permalink
Fix 318645 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyFilchenkov committed Mar 22, 2019
1 parent 8a9f615 commit 3d33404
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Sitecore.Support.315324/InjectCompositeComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ public override List<XElement> GetDevices(XElement layoutXml, ID contextDeviceId
#endregion

devices = FilterDevicesByDeviceId(devices, contextDeviceId);
if (!devices.Any() && Context.Device.FallbackDevice != null)

if (!devices.Any())
{
return GetDevices(layoutXml, Context.Device.FallbackDevice.ID);
var fallbackDevice = Context.Database.Resources.Devices[contextDeviceId]?.FallbackDevice; // Sitecore.Support.318645

if (fallbackDevice != null)
{
return GetDevices(layoutXml, fallbackDevice.ID); // Sitecore.Support.318645
}
}
return devices;
}
Expand Down

0 comments on commit 3d33404

Please sign in to comment.