FolderService can't find existing folder

Hello,
We have an application where we recently upgraded from Litium 5 to Litium 6 and we are re-writing some of the media folder logic.
this is the code we have:

folderName = "10606-214";
var folder = _folderService.Get(folderName);
if (folder == null)
{
 var newFolder = new Folder(parentFolder.FieldTemplateSystemId, folderName)
            {
                ParentFolderSystemId = parentFolder.SystemId
            };
            _folderService.Create(newFolder);
}

This will throw an exception:
{"Validation error for Folder(SystemId: 6a65c3b7-b978-4d98-a113-88159a5b351e), _nameInvariantCulture: 'There is already a folder named '10606-214''."}

Why doesnt folderservice return a result when the folder exists?

Litium version: 6.3.6

The folder service can search either by Guid or by id, while the validation checks that a folder with the same name doesn’t exist under the same parent folder.

Check your DB tables for any wrong values.

Yes my bad. However in Litium 5 an ID field doesnt exist in MediaArchive_Folder and we get everything by name. Shouldn’t that name be converted to ID when running the upgrade script to Litium 6?
Either way we have found a solution to the problem.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.