From 273d7f59b66b355d4398576721fa7cb91f5fa69b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 7 Aug 2005 15:30:03 +0000 Subject: - Patch #27713 by tostinni: fixed two problems on the block add page: + description field isn't marked as requiered +when the field isn't unique, an error is displayed, but the wrong text field is set as erronous. --- modules/block.module | 4 ++-- modules/block/block.module | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/block.module b/modules/block.module index 33867faea..5ab064d80 100644 --- a/modules/block.module +++ b/modules/block.module @@ -340,7 +340,7 @@ function block_box_form($edit = array()) { $output = form_textfield(t('Block title'), 'title', $edit['title'], 60, 64, t('The title of the block as shown to the user.')); $output .= filter_form('format', $edit['format']); $output .= form_textarea(t('Block body'), 'body', $edit['body'], 60, 15, t('The content of the block as shown to the user.')); - $output .= form_textfield(t('Block description'), 'info', $edit['info'], 60, 64, t('A brief description of your block. Used on the block overview page.', array('%overview' => url('admin/block')))); + $output .= form_textfield(t('Block description'), 'info', $edit['info'], 60, 64, t('A brief description of your block. Used on the block overview page.', array('%overview' => url('admin/block'))), NULL, TRUE); return $output; } @@ -355,7 +355,7 @@ function block_box_save($edit, $delta = NULL) { } else { if (empty($edit['info']) || db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'", $edit['info']))) { - form_set_error('title', t('Please ensure each block description is unique.')); + form_set_error('info', t('Please ensure that each block description is unique.')); return false; } db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']); diff --git a/modules/block/block.module b/modules/block/block.module index 33867faea..5ab064d80 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -340,7 +340,7 @@ function block_box_form($edit = array()) { $output = form_textfield(t('Block title'), 'title', $edit['title'], 60, 64, t('The title of the block as shown to the user.')); $output .= filter_form('format', $edit['format']); $output .= form_textarea(t('Block body'), 'body', $edit['body'], 60, 15, t('The content of the block as shown to the user.')); - $output .= form_textfield(t('Block description'), 'info', $edit['info'], 60, 64, t('A brief description of your block. Used on the block overview page.', array('%overview' => url('admin/block')))); + $output .= form_textfield(t('Block description'), 'info', $edit['info'], 60, 64, t('A brief description of your block. Used on the block overview page.', array('%overview' => url('admin/block'))), NULL, TRUE); return $output; } @@ -355,7 +355,7 @@ function block_box_save($edit, $delta = NULL) { } else { if (empty($edit['info']) || db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'", $edit['info']))) { - form_set_error('title', t('Please ensure each block description is unique.')); + form_set_error('info', t('Please ensure that each block description is unique.')); return false; } db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']); -- cgit v1.2.3