Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
upload.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
4 Apr 2006 at 19:11 UTC
Updated:
25 Jun 2006 at 22:45 UTC
Jump to comment: Most recent file
The array of files returned by upload_load is in no particular order. This patch adds an ORDER BY to the query so that array_pop on the result array will give you the file with the lowest fid. It then becomes possible to do things with the files based on their order.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | upload.patch.txt | 806 bytes | killes@www.drop.org |
| 57307.patch | 759 bytes | robertdouglass |
Comments
Comment #1
dopry commentedcode looks good... idea is sound.
Comment #2
moshe weitzman commented+1 from me too. code looks proper. minimal change.
Comment #3
gerhard killesreiter commentedapplied
Comment #4
(not verified) commentedComment #5
jhriggs commentedOK, although the idea may be sound, this broke a lot of feeds. Upload.module encloses the first attached file in feeds. By ordering with fid DESC rather than ASC, this changed the enclosed file on any feed items with more than one attachment. So, for instance, all of my podcasts that have a PPT slideshow attached also are now completely borked, because they enclose the pdf file rather than the mp3. While I agree the attachments should be ordered, they should be ordered ascending rather than descending (or it should be an option).
Comment #6
jhriggs commented(I should have mentioned, of course, that it breaks things when upgrading from a previous version.)
Comment #7
gerhard killesreiter commentedWe chould probably change DESC to ASC (or simply remove it).
Comment #8
killes@www.drop.org commentedSolution: Remove DESC
Comment #9
dries commentedLooks OK to me.
Comment #10
killes@www.drop.org commentedapplied to 4.7.
Comment #11
robertdouglass commentedDoes that mean it is closed? Or are we waiting to have it forward-ported to HEAD?
Comment #12
killes@www.drop.org commentedwe are just waiting for Dries to commit to HEAD.
Comment #13
drummCommitted to HEAD.
Comment #14
(not verified) commented