/[drupal]/contributions/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc
ViewVC logotype

Diff of /contributions/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.11, Tue Nov 3 19:04:00 2009 UTC revision 1.1.2.12, Tue Nov 3 19:16:25 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: content_multigroup.node_form.inc,v 1.1.2.10 2009/08/10 04:07:51 markuspetrux Exp $  // $Id: content_multigroup.node_form.inc,v 1.1.2.11 2009/11/03 19:04:00 markuspetrux Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 395  function content_multigroup_node_form_va Line 395  function content_multigroup_node_form_va
395        }        }
396      }      }
397    
398      if ($group_required && count($non_empty_subgroups) == 0) {      if (empty($non_empty_subgroups)) {
399        form_set_error('', t('Group @name requires one collection of fields minimum.', array('@name' => t($group['label']))));        if ($group_required) {
400            // This multigroup is required, but we have no subgroup of items.
401            form_set_error('', t('Group @name requires one collection of fields minimum.', array('@name' => t($group['label']))));
402          }
403          else {
404            // This multigroup is not required and we have no subgroup of items,
405            // which is correct. However, we now need to ensure CCK will not fire
406            // validation errors related to the fields in this multigroup from
407            // content_multiple_value_nodeapi_validate().
408            // To do so, we are creating a private array in the $form_state, and
409            // that will be available from the $node object processed during
410            // hook_nodeapi('validate'), which is where CCK enforces field
411            // requirement for multiple value fields.
412            foreach (array_keys($group_fields) as $field_name) {
413              $form_state['values']['_content_ignore_required_fields'][$field_name] = TRUE;
414            }
415          }
416      }      }
417    }    }
418  }  }

Legend:
Removed from v.1.1.2.11  
changed lines
  Added in v.1.1.2.12

  ViewVC Help
Powered by ViewVC 1.1.2