Download & Extend

Finish moving upload.module to DB:TNG

Project:Drupal core
Version:7.x-dev
Component:upload.module
Category:task
Priority:normal
Assigned:CitizenKane
Status:closed (fixed)

Issue Summary

Parts of upload.module had not been converted to DB:TNG. Patch is attached which remedies that.

AttachmentSizeStatusTest resultOperations
upload-module-dbtng.patch2.92 KBIdleUnable to apply patch upload-module-dbtng.patchView details

Comments

#1

Status:needs review» needs work

The $fields array for the insert query in the last hunk should be inline in the fields() method, to be consistent with the rest of core. That is:

<?php
db_insert
('upload')
  ->
fields(array(
   
'fid' => $file->fid,
   
'nid' => $node->nid,
   
'vid' => $node->vid,
   
'list' => $file->list,
   
'description' => $file->description,
   
'weight' => $file->weight,
  ))
  ->
execute();
?>

The same for the db_update() call right after it. Also, please break each method out to its own line as above, with each method indented two spaces from the first line. Otherwise this looks good.

#2

Status:needs work» needs review

Re-rolled patch. Fixed style as per #1.

AttachmentSizeStatusTest resultOperations
upload-module-dbtng.patch3.03 KBIdleUnable to apply patch upload-module-dbtng_0.patchView details

#3

Status:needs review» reviewed & tested by the community

Looks good to me. Tests still pass. RTBC.

#4

looks good to me too.

#5

It appears this patch has just been committed, and I was just about to chime in to say it looks good!

#6

Status:reviewed & tested by the community» fixed

Forgot to mark it as fixed. Thanks for the patch.

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

#8

This patch broke upload permissions. :P

#371206: upload_file_download() Blocks Access to Files Upload Doesn't Own fixes the problem again.

nobody click here