Fix the project view state migration issue.

This fixes #6934 and #6954.

@dangoor Can you review this fix?