Closed (fixed)
Project:
Project
Version:
5.x-1.x-dev
Component:
Releases
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Dec 2006 at 00:50 UTC
Updated:
28 Jul 2007 at 17:09 UTC
Jump to comment: Most recent file
the downloads table on project nodes (http://drupal.org/node/89539) is broken on sites where:
a) cvs.module isn't enabled
b) users create release nodes and don't attach files (the file upload isn't a required field)
c) releases are published by default.
none of these conditions are particularly rare. project_release_table() should be smarter about the case where file_path is still NULL and do something more reasonable in that case (e.g. print "n/a" for the date and size, and not include a Download link).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | project_release_download_table_fix_2.txt | 2.54 KB | dww |
| #6 | project_release_download_table_fix_1.txt | 2.44 KB | aclight |
| #3 | project_release_download_table_fix_0.png | 1.29 KB | aclight |
| #2 | project_release_download_table_fix.txt | 1.52 KB | aclight |
Comments
Comment #1
aclight commentedthis happens in 5.x-dev version also. I'm working on a patch for this.
AC
Comment #2
aclight commentedHere's a patch that fixes the problem. It checks to see if $release->file_path has a value, and if not it doesn't create a link for downloads and returns 'n/a' for both the size and date.
Comment #3
aclight commentedHere's a screenshot of how the download table looks now. I'm not wild about the lack of alignment, but I'm not sure what the best way to get around that is. We could have the "Download" text there but not have it be linked, but I think that could be confusing. This can probably be fixed in CSS, but I'm not sure how to do that. Any other ideas?
AC
Comment #4
bonzinip commentedThe patch at http://drupal.org/node/152638 instead uses the node creation date, rather than "n/a", as the date if no file was uploaded.
Comment #5
dwwYeah, actually, there's things I like and don't like about each of your patches. ;) It'd be nice to have a single patch that was the best of both. Basically, http://drupal.org/files/issues/project.paolo_.diff, but without introducing E_ALL warnings and code style violations, and also getting the filesize right. ;)
Anyone care to re-roll?
Comment #6
aclight commentedThe attached patch uses the project_release node creation date as the date displayed on the release table if a file is not attached to the release. Otherwise, it does the same thing as my original patch.
Comment #7
dwwExcellent, that looks ideal. I'll give it a little testing soon and get this in. Thanks!
Comment #8
dwwDang, I broke this patch with a code-style cleanup commit. :( It's a pretty trivial re-roll, stay tuned.
Comment #9
dwwComment #10
dwwYup, that's a winner, all right. ;) Tested heavily, committed to HEAD, backported and committed to DRUPAL-4-7--2. Thanks, everyone.
Comment #11
(not verified) commented