Trying to navigate directly to the edit view of a file by URL would fail if a folder other than the file’s parent was held in session data. Removed reliance on current ID in session and added folder detection for edit view.