From 1b5c3f65e576ebbcfedaeaad8c18cc686cca89fa Mon Sep 17 00:00:00 2001 From: jao28 Date: Thu, 10 May 2012 10:53:18 -0700 Subject: [PATCH] #18677: Fixing BodyPart driver with MediaPickerField Work Item: 18677 --HG-- branch : 1.4.x --- src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs index 79dfbd0d9..b88ad139d 100644 --- a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs @@ -120,10 +120,16 @@ namespace Orchard.Core.Common.Drivers { private void Add(string segment) { if (string.IsNullOrEmpty(segment)) return; - if (string.IsNullOrEmpty(_path)) + + if (string.IsNullOrEmpty(_path)) { _path = segment; - else + } + else if (segment.StartsWith("/")) { + _path = _path + segment; + } + else { _path = _path + "/" + segment; + } } } }