summaryrefslogtreecommitdiff
path: root/modules/upload/upload.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-02-12 13:49:01 +0000
committerDries Buytaert <dries@buytaert.net>2008-02-12 13:49:01 +0000
commit0f1085201e6aeded3119075dd3ef442317c026c2 (patch)
tree995fb0a8f0acb522c9aa2b9ec951f43f09d52aad /modules/upload/upload.module
parent3c4d568984b883736a04725fec477f21a2dc51d7 (diff)
downloadbrdo-0f1085201e6aeded3119075dd3ef442317c026c2.tar.gz
brdo-0f1085201e6aeded3119075dd3ef442317c026c2.tar.bz2
- Patch #219883 by gdevlugt and webernet: files attached to newly created nodes are listed despite unchecking list option.
Diffstat (limited to 'modules/upload/upload.module')
-rw-r--r--modules/upload/upload.module14
1 files changed, 0 insertions, 14 deletions
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index d69e5fda9..d291faa39 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -168,13 +168,6 @@ function upload_file_download($file) {
function upload_node_form_submit($form, &$form_state) {
global $user;
- // $_SESSION['upload_current_file'] tracks the fid of the file submitted this page request.
- // form_builder sets the value of file->list to 0 for checkboxes added to a form after
- // it has been submitted. Since unchecked checkboxes have no return value and do not
- // get a key in _POST form_builder has no way of knowing the difference between a check
- // box that wasn't present on the last form build, and a checkbox that is unchecked.
- unset($_SESSION['upload_current_file']);
-
$limits = _upload_file_limits($user);
$validators = array(
'file_validate_extensions' => array($limits['extensions']),
@@ -187,7 +180,6 @@ function upload_node_form_submit($form, &$form_state) {
$file->list = variable_get('upload_list_default', 1);
$file->description = $file->filename;
$file->weight = 0;
- $_SESSION['upload_current_file'] = $file->fid;
$_SESSION['upload_files'][$file->fid] = $file;
}
@@ -493,12 +485,6 @@ function _upload_form($node) {
$form['files'][$key]['size'] = array('#value' => format_size($file->filesize));
$form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => !empty($file->remove));
$form['files'][$key]['list'] = array('#type' => 'checkbox', '#default_value' => $file->list);
- // If the file was uploaded this page request, set value. this fixes the
- // problem formapi has recognizing new checkboxes. see comments in
- // _upload_prepare.
- if (isset($_SESSION['upload_current_file']) && $_SESSION['upload_current_file'] == $file->fid) {
- $form['files'][$key]['list']['#value'] = variable_get('upload_list_default', 1);
- }
$form['files'][$key]['weight'] = array('#type' => 'weight', '#delta' => count($node->files), '#default_value' => $file->weight);
$form['files'][$key]['filename'] = array('#type' => 'value', '#value' => $file->filename);
$form['files'][$key]['filepath'] = array('#type' => 'value', '#value' => $file->filepath);