Sorry, for the delay and thanks for the quick response.
No, there's no errors other than mail parsing ones, so no related errors.
It happened again with uploaded files, I think this may have been something I did, while trying to create a folder structure ahead so I can organize things better with this fresh install, I ended up creating and deleting a bunch of folders. I would have thought this was something as a result of deleting a folder that has a file in it, that wouldn't explain why a newly created file doesn't show unless it's possible the folder ID is still cached somewhere and written to, causing same effect.
I cloned the repo, used AI to analyze the content to figure out where to start troubleshooting. I was able to fix it for the two instances. I'm not a developer, but I hope this is helpful.
## Symptoms
- Files or documents uploaded to ITFlow are not visible in the client interface despite existing in the database
- The total number of files/documents indicated on the left sidebar is greater than the actual number visible in the interface
- You can see a count of items (e.g., "4" under documents or Files) but less than 3 items appear when you click into the Documents or Files menu
## The Cause
The most common cause is that files or documents are assigned to folder IDs that don't exist in the database. This can happen if folders were deleted without properly reassigning the files/documents first.
## How to Fix It
### Step 1: Connect to the database
```
mysql -u root -pUSE itflow;
```
### Step 2: Find the client ID
```
SELECT client_id, client_name FROM clients WHERE client_name LIKE '%Client Name%';
```
You'll see something like:
```
client_id | client_name
----------+---------------
1 | Example Client
```
### Step 3: Check the files/documents
For files:```
SELECT file_id, file_name, file_folder_id FROM files WHERE file_client_id = [client_id];
```
For documents:```
SELECT document_id, document_name, document_folder_id FROM documents WHERE document_client_id = [client_id];
```
Example result:```
file_id | file_name | file_folder_id
--------+------------------+---------------
1 | example-file.zip | 2
```
### Step 4: Check if the folder exists
```
SELECT * FROM folders WHERE folder_id = [folder_id];
```
If this returns nothing (empty set), you've found the problem!
### Step 5: See available folders
```
SELECT folder_id, folder_name FROM folders WHERE folder_client_id = [client_id];
```
Example:```
folder_id | folder_name
----------+-------------
4 | Documentation5 | Admin Guides
```
### Step 6: Fix the issue
Move the file/document to a valid folder:
```
-- Move to root folder (always visible)UPDATE files SET file_folder_id = 0 WHERE file_id = [file_id];
-- OR move to specific folderUPDATE files SET file_folder_id = 4 WHERE file_id = [file_id];
```
For documents, use:```
UPDATE documents SET document_folder_id = 0 WHERE document_id = [document_id];
```
### Step 7: Verify the fix
```
SELECT file_id, file_name, file_folder_id FROM files WHERE file_client_id = [client_id];
```
You should now see the file with a valid folder ID.
