Description

There is a potential bug in ULevel::FixupActorFolders() in the FixDuplicateFolders section:

Suppose you have a folder hierarchy that looks like this:

  • A
    • B(1)
    • B(2)
      • C(1)
    • B(3)
      • C(2)

where the letters are the names of the folders and the numbers are used to distinguish between folders with duplicate names. All the folder paths are:

  • A
  • A/B(1)
  • A/B(2)
  • A/B(2)/C(1)
  • A/B(3)
  • A/B(3)/C(2)

All but the first are duplicates. There will be two sets of folders in PathToFolders:

  • A/B(1)
  • A/B(2)
  • A/B(3)

and

  • A/B(2)/C(1)
  • A/B(3)/C(2)

SortedDuplicatePaths will contain:

  • A/B
  • A/B/C

After the first pass through the loop starting at line 3043 of Level.cpp, FoldersToKeep will contain:

  • A/B(1)

and FoldersToDelete will contain:

  • A/B(2)
  • A/B(3)

The problem happens in the second pass through the loop during the search for FolderToKeep. The parent of A/B(2)/C(1) is A/B(2) and the parent of A/B(3)/C(2) is A/B(3). Both are to be deleted. As a result, FolderToKeep is not set and the check() on line 3058 fails.

Steps to Reproduce
  • Create a WP Map
  • Create Folder A
  • Create SubFolder B (under A)
  • Save/Close WP map
  • Shelve and delete from disk SubFolder B package file
  • Reopen WP map
  • Create SubFolder B (under A)
  • Create SubFolder C (under B)
  • Save/Close WP map
  • Shelve and delete from disk SubFolder B and SubFolder C package files
  • Reopen WP map
  • Create SubFolder B (under A)
  • Create SubFolder C (under B)
  • Save/Close WP map
  • Unshelve all deleted files
  • Reopen WP map

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-247282 in the post.

0
Login to Vote

Fixed
Affects Versions5.4
Target Fix5.6
Fix Commit39907446
CreatedFeb 10, 2025
ResolvedFeb 11, 2025
UpdatedMar 3, 2025
View Jira Issue