Tuesday, September 4, 2012

Moving list items with "Manage Content and Structure"

File this one under "lazy programming".

It's well-documented that you can move list items around using SharePoint's Content and Structure manager in SP2007 and higher, much in the same way that you can use Explorer View in document libraries to shuffle things around.

I was tasked with making portions of several lists visible to external entities. No problem I say, we simply break them out into folders, secure the folders, and modify the existing views to ignore folders. Like any good admin, of course, I created my folders, moved the files, and then turned off the Create Folders option, because I don't want people to start going nuts with the folders and expose things they don't intend to be exposed.

A bit of background information - One of these lists was already problematic due to some SPD editing in SP2007 that apparently did not translate well in our migration to SP2010, so I was eager to blow this list away and recreate it. One of the issues at hand was the fact that the selected view always said "Default", even though none were named Default and sometimes when selecting views, the view would change, and sometimes it wouldn't, and it almost consistently ignored whatever the settings in the Modify View page indicated. That there was a Modify View page at all should indicate that our XSLT data view part is not fully-converted. The view itself appeared to work to the end user, but it we were unable to maintain it since SPD didn't recognize its own handiwork any longer and SP2010 felt the same way. I expect that in the background, there was a separate list view web part that was being modified but it was not visible on the web part page for the view.

Anyway.

So, inevitably, after moving everything into the new list (and creating content types!), I find out that a bunch of the content is missing. Naturally, I should've checked that the list item count in View All Site Content matched, but I'm used to using List Totals to do that, and well...when you can't trust the views, that obviously doesn't work very well!

Again, anyway. (This does have a point.)

I restore the old list under a new name, and then I start to try to migrate in the content, but alas - I cannot move it into the new folder directly? When I use Content and Structure to select the subfolder to put the missing list items, the expansion doesn't occur and the + simply disappears. I had created two other similar lists, and those worked fine, so what gives? Is it an issue with the default view hiding folders? I tried to change default views in the new list to one that doesn't hide the folder content type, but that didn't help.

It turned out that some sloppiness on my part gave way to the ultimate solution here. Content and Structure will check if a list has Create Folders turned on before it tries to iterate and display the folder list. Since I failed to turn off Create Folders in the other lists, they would expand normally in the target selection dialog. Turning on Create Folders in the affected library restored my ability to select subfolders as a copy/move target in Content and Structure.

This one puzzled me for a few hours across a couple of days, and I'm not exactly sure how one would find the solution to such a problem, but if this post helps at least one person save a little time (and not just a spambot that says "your solution worked for me thanks"), then it will have been worthwhile.

1 comment:

  1. OK, I'm not a spambot, but your solution worked for me. Thanks!

    ReplyDelete