Summary: | Add the ability to replace an uploaded image | ||
---|---|---|---|
Product: | Koha | Reporter: | Christopher Brannon <cbrannon> |
Component: | Tools | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
Christopher Brannon
2025-05-01 20:56:17 UTC
Replace images where? (In reply to Owen Leonard from comment #1) > Replace images where? Where ever Koha stores images when you upload them. Are you referring to the "Tools > Uploads" feature? -- It looks like the key is a MD5 hash of a whole bunch of different parameters. For temporary uploads, the time of the upload is one of the parameters, which is weird. For permanent up loads, time isn't used. But for all uploads, the first 2048 bytes of the file is also used as one of the parameters. Honestly, I find that a bit... wild. Surely just hashing the category + filename would've been sufficient. That said... if you replace the contents of a file and don't change the hashvalue, you could experience caching problems. Pros and cons to the different methods. I suppose there could be a system preference that allows for different methods for computing the hash value. Not something I'm likely to work on, but it's an interesting idea. It actually makes you think a bit about the philosophy of files and documents in general. What IS the document? Is it the name, is it the content, etc. Anyway, if you're not referring to "Tools > Uploads", then the answer might be something else. Honestly, I am referring to any file that can be uploaded. Yes, the Tools --> Uploads is one example, but cover images, patron images, documents linked in records. There should be a process to replace these files without having to break any links to them. (In reply to Christopher Brannon from comment #4) > Honestly, I am referring to any file that can be uploaded. Yes, the Tools > --> Uploads is one example, but cover images, patron images, documents > linked in records. There should be a process to replace these files without > having to break any links to them. So they all use different mechanisms. Cover images should already be replaceable I think. Same for patron images. Not sure what you mean by "documents linked in records". That might be the upload.pl cataloguing plugin? That one would be the same as what I've described above. But then changing a URL when editing a record shouldn't be a big deal. Yes, upload.pl. That is not a plugin as far as I can tell. But this one definitely does not have a mechanism for replacing a file. I can delete, and I can upload (which is goofed up, by the way - if I delete a file, then try to upload, it doesn't do anything, and I have to do it again). (In reply to Christopher Brannon from comment #6) > Yes, upload.pl. That is not a plugin as far as I can tell. But this one > definitely does not have a mechanism for replacing a file. I can delete, > and I can upload (which is goofed up, by the way - if I delete a file, then > try to upload, it doesn't do anything, and I have to do it again). Is it the one that you access through the cataloguing editor? The underlying script used for that is "cataloguing/value_builder/upload.pl" which sometimes gets referred to as a "cataloguing plugin" - different thing from a Koha Plugin. (In reply to David Cook from comment #7) > (In reply to Christopher Brannon from comment #6) > > Yes, upload.pl. That is not a plugin as far as I can tell. But this one > > definitely does not have a mechanism for replacing a file. I can delete, > > and I can upload (which is goofed up, by the way - if I delete a file, then > > try to upload, it doesn't do anything, and I have to do it again). > > Is it the one that you access through the cataloguing editor? > > The underlying script used for that is "cataloguing/value_builder/upload.pl" > which sometimes gets referred to as a "cataloguing plugin" - different thing > from a Koha Plugin. No, it is through tools: /cgi-bin/koha/tools/upload.pl |