2

We are using Sitecore 7 SP1.

I have renamed a media folder, both its item & display name. The item with the image field still shows the media path with the old name, but somehow the image is displayed in the field.

When I click to browse for the image field, it points to the correct image in the tree. On clicking OK, the correct path then reflects in the image field.

I tried database relinking, clearing cache and also indexing. No luck.

Is this a bug?

Before Renaming: enter image description here

After Renaming enter image description here

6
  • Can you add some screenshots so it's easier to understand your issue?
    – Marek Musielak
    Aug 20, 2019 at 15:47
  • 1
    I am not sure here, it should work properly but it may be a caching issue. but Sitecore store the media in the field with media id so no matter if you move or rename the media items in the path it will work fine. Could you please try by clearing your cache? Aug 20, 2019 at 16:12
  • @MarekMusielak I have updated the images. Please have a look.
    – sukesh
    Aug 21, 2019 at 10:31
  • @MahendraShekhawat Clearing the cache also did not work.
    – sukesh
    Aug 21, 2019 at 10:32
  • 1
    Sitecore 6.6 stored image fields like this <image mediaid="{D7F0E23E-5B28-4CDF-B75B-B9C9DE0C3088}" mediapath="/Project/Components/2 Column Portfolio Listing" src="~/media/D7F0E23E5B284CDFB75BB9C9DE0C3088.ashx" />. 7.2 does it by ID only. You fall somewhere in the middle.
    – Mark Cassidy
    Aug 21, 2019 at 10:57

1 Answer 1

3

It's normal behaviour (and likely one of the reasons why this was later changed).

Back then, Sitecore stored a media item with an XML structure that looked like this:

<image mediaid="{D7F0E23E-5B28-4CDF-B75B-B9C9DE0C3088}" mediapath="/Project/Components/2 Column Portfolio Listing" src="~/media/D7F0E23E5B284CDFB75BB9C9DE0C3088.ashx" />

So it included a Media Path. Renaming the Media Item would not forcibly go to all Image fields that referred the Media Item and update this path. But by and large, when generating the link, the updated information (and therefore path) would take effect.

I don't know exactly when this changed, but Sitecore 7.2 doesn't store it like this. It stores the media id only; like <image mediaid="{A0C1DCFD-3D90-478F-864F-D448D9467ABB}" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.