summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/admin.inc4
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index c440c7c..34165a5 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -16,6 +16,7 @@ Views 2.x
o #463580 by ximo: AJAX summary links broken in some displays.
o #468336 by psynaptic: Fix broken hook_views_admin_links_alter
o #422868 by mattman: Breadcrumbs not properly substuting % replacements.
+ o #440676 by dereine and Razorraser: View import form crashed on empty view input.
Other changes:
o #298616: Add argument for node updated time similar to node created time.
diff --git a/includes/admin.inc b/includes/admin.inc
index b8bfa79..3ff5460 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -745,6 +745,7 @@ function views_ui_import_page(&$form_state) {
$form['view'] = array(
'#type' => 'textarea',
'#title' => t('Paste view code here'),
+ '#required' => TRUE,
);
$form['submit'] = array(
@@ -760,13 +761,14 @@ function views_ui_import_page(&$form_state) {
* Validate handler to import a view
*/
function views_ui_import_validate($form, &$form_state) {
+ $view = '';
views_include('view');
ob_start();
eval($form_state['values']['view']);
ob_end_clean();
if (!is_object($view)) {
- form_error($form['view'], t('Unable to interpret view code.'));
+ return form_error($form['view'], t('Unable to interpret view code.'));
}
if (empty($view->api_version) || $view->api_version < 2) {