Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
file system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
1 Jan 2009 at 18:18 UTC
Updated:
29 Aug 2012 at 14:44 UTC
Jump to comment: Most recent file
Attached patch does the following things:
1. Removes FILE_STATUS_TEMPORARY. Because $file->status is a bitmapped field, having FILE_STATUS_TEMPORARY for the 0 value of this field doesn't make sense.
2. Fixes issues with the use of FILE_STATUS_PERMANENT to ensure that it is treated more uniformly as a binary flag.
3. Fixes a logic issue with $file->status in upload.module.
At present all tests still pass.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | file_353207.patch | 5.91 KB | drewish |
| remove-file_status_temp.patch | 5.74 KB | theflowimmemorial |
Comments
Comment #1
drewish commentedGlad you took this up. The whole temporary constant has bothered me for a while but I'd never gotten around to rolling a patch.
I cleaned up the file.inc docs to make it clear what FILE_STATUS_PERMANENT does since FILE_STATUS_TEMPORARY's comment is being removed.
I fiexed the spacing on
+ $file->status |= FILE_STATUS_PERMANENT;to line up with all the other assignments.I dropped the changes to system_cron() since the current code is fine.
Comment #2
dries commentedGood clean-up. Committed to CVS HEAD. Kudos to both.
Comment #3
drewish commentedthanks, added the change to the update docs: http://drupal.org/node/224333#remove_FILE_STATUS_TEMPORARY
Comment #4
xanoI have no experience with bitmap flags (or whatever they're called), but removing FILE_STATUS_TEMPORARY seems very bad for readability from my point of view.
Comment #5
drewish commentedit's less readable but the problem with it was that it didn't really do anything and encouraged people to set the status in a way that would preclude other bits from being used.
Comment #7
amonteroLinking to related feature request for consideration:
#1659116: Define FILE_STATUS_TEMPORARY and expose $status in file_save_data