This project is read-only.

FormatException in MediaLibrary module

Topics: Troubleshooting
Jul 21, 2013 at 7:58 PM
Edited Jul 21, 2013 at 9:34 PM
I thought I successfully upgraded my site to v1.7, but now I am getting the following error when I click on the Content link in the Admin screen's left sidebar menu. I am not (yet) a module developer, so I'm not sure what's causing the problem.

Jul 21, 2013 at 9:09 PM
Your image is not displaying.
Jul 21, 2013 at 9:19 PM
Edited Jul 21, 2013 at 9:19 PM
Weird, the PNG is displaying fine in my browser. I switched it to a JPEG in case the PNG is causing problems.
Jul 21, 2013 at 9:22 PM
It looks like the resource is protected. This is the url to the file:

When I navigate to that url, I'm asked to signin with my Microsoft account.
Jul 21, 2013 at 9:35 PM
Sorry about that. I just moved it to a public folder. I logged out of my Microsoft account and I was able to access it, so I hope that does the trick for you.
Jul 21, 2013 at 9:46 PM
Yep, there it is.
I'm afraid the storage for the Ids property on MediaLibraryPickerField contains a value that is unparsable to an int.
One way to find out how this data looks like is by setting a breakpoint on line 35 of MediaLibraryPickerFieldHandler.cs in Orchard.MediaLibrary/Handlers. You can then inspect what the content item id is as well, open the database table where this value is stored (Orchard_Framework_ContentItemVersionRecord, column Data) and correct the value.
Jul 21, 2013 at 10:54 PM
Thank you for the tips. Unfortunately, I'm using WebMatrix (it doesn't have a built-in debugger) and I can't figure out how to run the site in Visual Studio (I get tons of errors and warnings regarding missing assemblies and refernces when I try to open it as a Web Site in VS2012), so I'm kinda stuck. I looked up the Data column in the DB table, but I wouldn't know where to begin correcting the problematic values even if I understood what the problem was in the first place because I am not familiar with the DB schema yet.

This sort of troubleshooting is a little out of my league at this point, so I might just have to start from scratch with a fresh v1.7 install and give up on the upgrade from v1.6.1. Fortunately, my site has almost nothing in it yet, so this shouldn't be too much of a problem. Hopefully, by the time the next version comes out, I'll have a better idea what I'm doing, the official Orchard documentation will be better, and the upgrade process won't be quite as overwhelming as it is now. I'd really like to contribute to improving the docs, but I have to get over this initial learning curve first.

BTW, is this MediaLibraryPickerField issue a bug? I didn't tinker with anything when I was trying to do the upgrade, so I assume it is a bug in the upgrade process. According to CodePlex, v1.7 is listed as "Stable," so I assumed that it was relatively bug-free and safe to use at this point. Should I enter this in the "Issues"? I'm not sure what the protocol is.

Finally, do you or anyone you know in the Orchard community provide as-needed, mentoring services (for a fee) for novices such as myself who are trying to get over the initial hump and eventually become Orchard developers?

Thanks again for the help.
Jul 28, 2013 at 9:51 PM
Edited Jul 28, 2013 at 9:51 PM
It could be a bug, yes. If you can reproduce it, please create an issue with repro steps.

As for mentoring services provided-as-needed, I offer such services as well as Lombiq.
Feel free to send me a message.