OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Field 1.4 migration empties media picker field and YouTube field #2302

Closed orchardbot closed 9 years ago

orchardbot commented 12 years ago

@bleroy created: https://orchard.codeplex.com/workitem/18475

The migration empties media picker field values and also YouTube field values. Potentially others as well, although I've seen taxonomy fields work fine after migration.

orchardbot commented 12 years ago

@sebastienros commented:

On which types are they attached ?

(this is important as we fixed the versioning of fields)

orchardbot commented 12 years ago

@bleroy commented:

Here is the migration code that created the type:

        ContentDefinitionManager.AlterTypeDefinition("Product", cfg => cfg
          .WithPart("Product")
          .WithPart("CommonPart")
          .WithPart("RoutePart")
          .WithPart("BodyPart")
          .WithPart("ProductPart")
          .WithPart("CommentsPart")
          .WithPart("TagsPart")
          .Creatable()
          .Indexed());

        ContentDefinitionManager.AlterPartDefinition("Product",
          builder => builder.WithField("ProductImage", fieldBuilder => fieldBuilder.OfType("MediaPickerField").WithDisplayName("Product Image")));
orchardbot commented 12 years ago

TheMonarch commented:

I have the same issue, looks like Bertrand already entered a bug for it. I started getting it with changeset 8bfc5efd9bc5. If I revert to the changeset immediately before that the MediaPicker fields start to work again.

I am finding that my part with MediaPicker fields isn't importing anything into the MediaPicker fields when I run my recipes.

orchardbot commented 12 years ago

TheMonarch commented:

Not sure if related, but on latest code (37604fa6fe09) "Browse" button no longer works from the editor page of the types that use MediaPicker fields. Nothing happens when I click Browse; no errors in F12 browser dev console.

orchardbot commented 12 years ago

@sebastienros commented:

Sorry guys I can't repro ! I have a Draftable content and a non Draftable one, and I can migrate the Media Picker field without any problem. Are you sure the Orchard.Fields module is enabled too ?

orchardbot commented 12 years ago

TheMonarch commented:

My issue might be separate then. Mine isn't with migrating; most of my project works with autoroute now. The issue i have is the Parts that have MediaPicker fields aren't importing the MediaPicker field data from the recipes. Also, possibly related: the "Browse" button on MediaPicker fields no longer brings up the pop-up window to choose media.

The issue seems to have started with changeset 8bfc5efd9bc5. I can get everything workin again by reverting to the code before that changeset. I verified that Orchard.Fields module is enabled, and listed as a dependency in my module.txt.

Is there any other info I can give that might help troubleshoot? Or other things I can check on my end? I don't see any errors in the logs.

orchardbot commented 12 years ago

@sebastienros commented:

Can you provide a sample for the recipe with the media picker ? Might also open a separate bug for it then.

orchardbot commented 12 years ago

TheMonarch commented:

Here you go: http://orchard.codeplex.com/workitem/18488

I can email you a copy of my actual recipe if needed, don't want to post the full thing here.

orchardbot commented 12 years ago

@sebastienros commented:

Yes, please email

orchardbot commented 12 years ago

@bleroy commented:

You already have my database. The type is Product on the default tenant.

orchardbot commented 12 years ago

@sebastienros commented:

Fixed in changeset c345e32e4884

orchardbot commented 10 years ago

@sfmskywalker commented:

Fixed in changeset 1af2050db46f55df3f196496ace646651998c446