Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the parameter user_limit is 0, we dont need to call file_space_used.
Comment | File | Size | Author |
---|---|---|---|
#14 | 197266.patch | 1.03 KB | drewish |
#11 | file_197266.patch | 2.01 KB | drewish |
#5 | 197266-2.patch | 1.89 KB | c960657 |
#4 | 197266.file_validate_size.patch | 1.31 KB | Dave Reid |
#2 | file.inc_.quota_2.patch | 1.23 KB | lilou |
Comments
Comment #1
drewish CreditAttribution: drewish commentedComment #2
lilou CreditAttribution: lilou commentedReroll.
Comment #3
drewish CreditAttribution: drewish commenteda small change to help avoid an extra query.
Comment #4
Dave ReidLooks like you're missing a closing brace on that if statement. Also please use cvs diff -uP so we can get the relevant function name in the diff. Here's a revised patch that also fixes the PHP doc for $user_limit.
Comment #5
c960657 CreditAttribution: c960657 commentedReroll. file_validate_size() is already covered by unit tests.
Comment #7
drewish CreditAttribution: drewish commentedignore DrupalTestbedBot it's buggy: #307197: Testing the incorrect patch posting multiple comments.
Comment #8
drewish CreditAttribution: drewish commentedjust re-ran the tests, they're still good. simple enough patch too.
Comment #9
webchickThanks, committed! Looks like this could go in 6.x too.
Comment #10
Gábor HojtsyLooks like a good improvement. However (1) it does not apply to Drupal 6 (2) I'd add a comment to the if() which would explain that the function call is in there to help performance a bit. Otherwise someone might go and "prettify" if later on.
Comment #11
drewish CreditAttribution: drewish commentedhow's this look?
Comment #12
c960657 CreditAttribution: c960657 commentedLooks good.
Comment #13
Gábor HojtsyCommitted to Drupal 6. Let's get that added comment to Drupal 7 too.
Comment #14
drewish CreditAttribution: drewish commentedhere's that comment for D7
Comment #15
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #16
ufku CreditAttribution: ufku commentedAccording to the comment
"when a limit is provided we save a query by only calling file_space_used()"
Should't we
"save a query by not calling file_space_used when there is no user limit."
I mean the current comment is incoherent.
Or is it time to go to bed for me?