Permalink
Browse files

Added test if all contents of multifield are empty.

  • Loading branch information...
1 parent d4dd543 commit 2094ce05922e2c02686a49201b0c746059b5cd43 John committed Aug 7, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 system/expressionengine/third_party/alt_multifield/ft.alt_multifield.php
@@ -382,7 +382,10 @@ function replace_tag($multifielddata, $params=array(), $tagdata=FALSE) {
// Merge in the labels
$fieldoutputdata = array();
+ $is_empty_test = '';
foreach($multifielddata as $key=>$row) {
+
+ $is_empty_test .= trim($row);
if(isset($fieldsettings[$key])) { // checks that key still exists in settings
if('textarea' == $fieldsettings[$key]['type']) { // if it's a textarea, run it through the typography class
$fieldoutputdata[$key] = $this->EE->typography->auto_typography($row,TRUE);
@@ -396,6 +399,9 @@ function replace_tag($multifielddata, $params=array(), $tagdata=FALSE) {
$fieldoutputdata[$ktype] = $fieldsettings[$key]['type'];
}
}
+
+ // quick is empty test
+ if($is_empty_test == '') return '';
// Parse the tag
if (!$tagdata) { // Single tag

0 comments on commit 2094ce0

Please sign in to comment.