View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016851 | mantisbt | attachments | public | 2014-01-19 04:06 | 2016-07-11 15:48 |
Reporter | vboctor | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Product Version | 1.2.15 | ||||
Summary | 0016851: Downloading, viewing, and checking existence of attachments should get attachment location from db | ||||
Description | At the moment if a user changes the attachment storage from DISK to DATABASE or vice versa and ends with a mix, then the code will behave based on the latest config, rather than handling each attachment based on where it is saved. Ideally, all attachments are stored on DISK or DATABASE, but it is good to handle the transition case. | ||||
Tags | patch | ||||
This approach would hide some way that there is a problem with the MantisBT instance. If the setting is DATABASE, administrators expect that the database contains all data and they expect that making a backup of MantisBT is nothing more than backing up the database. |
|
I think it is annoying that we don't have a reliable / fast way right now to figure out where an attachment is stored. I think we should update the schema or the way we use it to quickly figure out what's going on. Then we can decide to support the scenario where there is a mis-match or recommend that users use a script like move_attachments. Your argument about administrator not knowing about the problem, will happen even if we show as broken, since users will only know about it when they open specific issues. Also including the pull request link: |
|
I also noticed today that if an admin runs the system utils to export attachments from database to disk on a MySQL database, the code will expose 2 byte files for attachments that were saved on disk and will link to those new 2 byte files instead of the real ones that exist on the attachments folder and were linked before. The ones that were in the database will be exported and linked properly. |
|
I'm not sure if it helps towards this issue, but when looking at this 1.3 blocking issue earlier today, and a similar issue I now can't find that damien commented on - I've added code to move_attachments.php to handle moving from disk to db and db to disk. Will generate a PR for that once I've caught up with dregad. It's not going to fix the user case (victor describes), nor whatever victor means with the 2 byte files - but upon seeing "attachment missing" in my local dev box, and going to move attachments system utility I've moved some files from disk<>db and back to disk successfully. Assuming that damien is happy with what I've done to his code, and that people are happy with the pull request for that, would that be enough to resolve this bug? In short, the admin page displays attachments: in db / attachments on disk / move to db / move to disk as 4 - therefore admin can see if the attachments are in a inconsistent state and fix. What it doesn't do is try to be clever around viewing the issue by 'searching' for possible matching content. |
|