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

V1.7.1 Media Picker Fields Migration Fails #4029

Closed orchardbot closed 9 years ago

orchardbot commented 11 years ago

TroyTempest created: https://orchard.codeplex.com/workitem/20201

In Upgrade.Controllers.MediaController.MediaPicker dynamic contentField = contentPart.Fields.FirstOrDefault(x => x.Name == match.Field.Name);

Is always null resulting in "Input string was not in a correct format." error.

orchardbot commented 11 years ago

@sebastienros commented:

Please provide some repro steps

orchardbot commented 11 years ago

TroyTempest commented:

I can only suggest that I send, or ftp or whatever, a copy of the site & db that the migration failed on. The migration worked fine on my dev. environment but failed when I attempted it against a copy of the production db.

It's about 3gb inc. media.

orchardbot commented 11 years ago

@sebastienros commented:

Could try to debug it with a break point when the exception occurs ? This would give a hint on what is throwing it

"Input string was not in a correct format" happens when a string is converted to a value (date, int, double, ...) but I don't see anything like this here.

orchardbot commented 11 years ago

TroyTempest commented:

OK. The Migration doesn't throw the exception. It appears to succeed but because this:

dynamic contentField = contentPart.Fields.FirstOrDefault(x => x.Name == match.Field.Name);

is null for every record then this:

contentField.Url = "{" + media.Id + "}";

doesn't get done which, (I think) is the source of the "Input string was not in a correct format" error when you try to open a page that's (not) got an image.

I included it in my description because there are a number of posts referring to it and this is as far as I've got tracking it down.

orchardbot commented 11 years ago

TroyTempest commented:

I've noticed you've downgraded the "Impact" to "Medium". Can I just point out that the site in question is our companies flagship orchard site and the fact that it (at present) can't be upgraded could be a bit of an issue.

I'm still a believer, of course.

orchardbot commented 11 years ago

@sebastienros commented:

have you tried with 1.7.x ? This case should be already handled there.

orchardbot commented 11 years ago

TroyTempest commented:

Yep. It's in the title - V1.7.1

orchardbot commented 11 years ago

@sebastienros commented:

V1.7.1 doesn't mean you are using 1.7.x. You are using 1.7.x if you intentionally downloaded the 1.7.x branch from the git repository. If not then you first need to try with this version as the bug might already have been fixed.

orchardbot commented 11 years ago

TroyTempest commented:

OK. I'll get the latest branch from GitHub and try again.

orchardbot commented 11 years ago

TroyTempest commented:

Job done. Thanks.