torsdag den 20. marts 2014

Sitecore 7.2, Media picker, The core database and alot of headaches

Okay, this is an interresting bug.

It seems like the new Media picker in Sitecore 7.x (the SPEAK version) has a bug - you can trigger it this way:

1: Create a template with an image field.
2: Set the source property of the field to a folder inside the media library.
3: Create an item based on this template, and click Browse on the image field.

Notice that no images from the folder is displayed.

To workaround this, the folder structure should be published to the core database (this is the real bug)......

Now, this workaround causes big problems with Sitecore 7.2, since the publishing framework has been changed, which means adding the core database as a publishing target is dangerous.

Here is a simple guide to trigger this problem:

1: Install clean Sitecore 7.2 initial release
2: Create "core" publishing target
3: Click the "Publish Item" button on the Core item
4: Select the /sitecore/layout/Layouts item
5: Click the "Publish Item" button on the Layouts item.
6: Press F5 to reload Sitecore
7: Open the content editor - you will now see "The layout cannot be found".
8: Open /sitecore/admin/dbbrowser.aspx , open the core database and see that the Layouts item no longer has any children.

This means, that if the Layouts (there are other items that is right as dangerous) item gets published to the core database - every layout defined the core database is wiped, and Sitecore is completely broken.

So, if you are using Sitecore 7.x (which you should, since it is great!), here is a better workaround untill the image picker can get fixed.

Create an include file, give it a name, os it gets loaded after Sitecore.Speak.config (Like Support.406666.config) (406666 is the issue number for this issue), and add this to it:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <overrideXmlControls>
      <override xmlControl="Sitecore.Shell.Applications.Media.MediaBrowser" with="/sitecore/client/applications/Dialogs/SelectMediaDialog">
        <patch:delete />
      </override>
    </overrideXmlControls>
  </sitecore>
</configuration>

This changes the media picker, so it reverts to using the old one, that works.

1 kommentar:

  1. Thanks! We're trying to upgrade our custom Sitecore environment to 7.2 and your config file resolved the issue of the 404 error that appears when we try to open the Media Browser from within Page Editor.

    SvarSlet