summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrel O\'Pry2008-08-11 22:16:42 (GMT)
committer Darrel O\'Pry2008-08-11 22:16:42 (GMT)
commit5af4912596757f2604210c75412d7034279a7d05 (patch)
tree7611a1d2e8f24c113bbc1b448fc5a39816791b82
parent2068eb407bebec0dbf2e7f9b072a9c2c04ebd94d (diff)
fix max filesizer per node validation, if max_size is not set do not check.
-rw-r--r--filefield.module5
-rw-r--r--filefield_widget.inc2
2 files changed, 6 insertions, 1 deletions
diff --git a/filefield.module b/filefield.module
index a22ae1a..8a210ed 100644
--- a/filefield.module
+++ b/filefield.module
@@ -286,6 +286,11 @@ function filefield_widget(&$form, &$form_state, $field, $items, $delta = 0) {
if (!in_array('filefield_node_form_validate', $form['#validate'])) {
$form['#validate'][] = 'filefield_node_form_validate';
}
+ if (!in_array('filefield_node_form_submit', $form['#submit'])) {
+ $form['#submit'][] = 'filefield_node_form_submit';
+ }
+
+
$default = array('fid' => 0, 'list' => 0, 'data' => array('description' => ''));
// assign defaults..
diff --git a/filefield_widget.inc b/filefield_widget.inc
index 713ab1a..f0e56c9 100644
--- a/filefield_widget.inc
+++ b/filefield_widget.inc
@@ -340,7 +340,7 @@ function filefield_node_form_validate($form, &$form_state) {
form_set_error($field_name, t('%title field is required.', array('%title' => $field['widget']['label'])));
}
$max_filesize = parse_size($field['widget']['max_filesize_per_node']);
- if ($total_filesize > $max_filesize) {
+ if ($max_filesize && $total_filesize > $max_filesize) {
form_set_error($field_name, t('Total filesize for %title, %tsize, exceeds field settings of %msize.',
array(
'%title' => $field['widget']['label'],