From fab4618bc6109ce40dbb81f32eec6e207875c292 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 13 Nov 2014 09:28:40 +0000 Subject: [PATCH] fix fatal error if customfields contains widget with no validation method --> nothing to validate / return --- etemplate/inc/class.etemplate_widget_customfields.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etemplate/inc/class.etemplate_widget_customfields.inc.php b/etemplate/inc/class.etemplate_widget_customfields.inc.php index d0af9632c4..706d9ad9fc 100644 --- a/etemplate/inc/class.etemplate_widget_customfields.inc.php +++ b/etemplate/inc/class.etemplate_widget_customfields.inc.php @@ -344,6 +344,8 @@ class etemplate_widget_customfields extends etemplate_widget_transformer } // run validation method of widget implementing this custom field $widget = $this->_widget($fname, $field_settings); + // widget has no validate method, eg. is only displaying stuff --> nothing to validate + if (!method_exists($widget, 'validate')) continue; $widget->validate($form_name != self::GLOBAL_ID ? $form_name : $cname, $expand, $content, $validated); if ($field_settings['needed'] && (is_array($value) ? !$value : (string)$value === '')) {