|  | @@ -46,6 +46,9 @@ function _ds_layout_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |    $fields_with_regions = array();
 | 
	
		
			
				|  |  |    $i = 0;
 | 
	
		
			
				|  |  |    $all_fields = array();
 | 
	
		
			
				|  |  | +  watchdog('debug', '<pre>$bundle_name: '. print_r($bundle_name, TRUE) .'</pre>');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  watchdog('debug', '<pre>$instances: '. print_r($instances, TRUE) .'</pre>');
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    try {
 | 
	
		
			
				|  |  |      // Get the bundle and term objects.
 | 
	
	
		
			
				|  | @@ -142,14 +145,17 @@ function _ds_layout_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |      // order to display fields in label alpha order.
 | 
	
		
			
				|  |  |      $right_fields = array();
 | 
	
		
			
				|  |  |      $all_field_groups = field_group_info_groups('TripalEntity', $bundle_name);
 | 
	
		
			
				|  |  | -    if (is_array($all_field_groups)) {
 | 
	
		
			
				|  |  | -      if (!isset($all_field_groups['default'])) {
 | 
	
		
			
				|  |  | -        $all_field_groups['default'] = array();
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -      foreach ($all_field_groups['default'] as $key => $field_name) {
 | 
	
		
			
				|  |  | -        $right_fields[$key] = $field_name;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    if(!empty($all_field_groups)){
 | 
	
		
			
				|  |  | +      if (is_array($all_field_groups)) {
 | 
	
		
			
				|  |  | +        if (!isset($all_field_groups['default'])) {
 | 
	
		
			
				|  |  | +          $all_field_groups['default'] = array();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        foreach ($all_field_groups['default'] as $key => $field_name) {
 | 
	
		
			
				|  |  | +          $right_fields[$key] = $field_name;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        usort($right_fields, tripal_ds_sort_object('label'));
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      usort($right_fields, tripal_ds_sort_object('label'));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      elseif(empty($all_field_groups)) {
 | 
	
		
			
				|  |  |        //Add the original instances that were passed and the field_groups that
 | 
	
	
		
			
				|  | @@ -250,9 +256,10 @@ function _ds_layout_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |        'layout_disable_css' => 0,
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |      $record->settings = $settings;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      drupal_write_record('ds_layout_settings', $record);
 | 
	
		
			
				|  |  |      // Clear the Drupal cache.
 | 
	
		
			
				|  |  | -    cache_clear_all();
 | 
	
		
			
				|  |  | +    drupal_flush_all_caches();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    catch (Exception $e) {
 | 
	
		
			
				|  |  |      watchdog_exception('tripal_ds', $e);
 | 
	
	
		
			
				|  | @@ -278,7 +285,6 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |    $all_fields = array();
 | 
	
		
			
				|  |  |    $instances_for_field_groups = array();
 | 
	
		
			
				|  |  |    $disabled_instances = array();
 | 
	
		
			
				|  |  | -  watchdog('debug', '<pre>$instances: '. print_r($instances, TRUE) .'</pre>');
 | 
	
		
			
				|  |  |    try {
 | 
	
		
			
				|  |  |      // Add Abstract, Citation, DB Cross Reference, Properties.
 | 
	
		
			
				|  |  |      $all_fields['tpub__abstract']= 'right';
 | 
	
	
		
			
				|  | @@ -293,15 +299,16 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |      foreach ($instances as $key => $instance) {
 | 
	
		
			
				|  |  |        $instance_name = $instance['field_name'];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      if($instance_name == 'tpub__abstract' || $instance_name == 'tpub__citation'
 | 
	
		
			
				|  |  | -        || $instance_name == 'sbo__database_cross_reference'
 | 
	
		
			
				|  |  | +      if($instance_name == 'sbo__database_cross_reference'
 | 
	
		
			
				|  |  |          || $instance_name == 'sio__references'){
 | 
	
		
			
				|  |  |          array_push($instances_for_field_groups, $instance);
 | 
	
		
			
				|  |  |          // Update the display settings so that the title is hidden.
 | 
	
		
			
				|  |  |          $instance['display']['default']['label'] = 'hidden';
 | 
	
		
			
				|  |  |          field_update_instance($instance);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      elseif($instance_name == 'schema__additional_type' || $instance_name == 'tpub__doi' || $instance_name == 'tpub__publication_date') {
 | 
	
		
			
				|  |  | +      elseif($instance_name == 'schema__additional_type' || $instance_name == 'tpub__doi'
 | 
	
		
			
				|  |  | +        || $instance_name == 'tpub__publication_date' || 'tpub__abstract' ||
 | 
	
		
			
				|  |  | +        $instance_name == 'tpub__citation') {
 | 
	
		
			
				|  |  |          array_push($properties, $instance_name);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        else {
 | 
	
	
		
			
				|  | @@ -335,9 +342,9 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |      //Properties table fields.
 | 
	
		
			
				|  |  |      if(!empty($properties)){
 | 
	
		
			
				|  |  |        _publication_prop_field_group_info($bundle_name, $properties);
 | 
	
		
			
				|  |  | -      array_unshift($properties, 'group_prop_tripalpane', 'group_prop_table');
 | 
	
		
			
				|  |  | +      array_unshift($properties, 'group_summary_tripalpane', 'group_summary_table');
 | 
	
		
			
				|  |  |        $region_right = array_merge($region_right, $properties);
 | 
	
		
			
				|  |  | -      $all_fields+= [ 'group_prop_tripalpane' => 'right', 'group_prop_table' => 'right' ];
 | 
	
		
			
				|  |  | +      $all_fields+= [ 'group_summary_tripalpane' => 'right', 'group_summary_table' => 'right' ];
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      if(!empty($all_fields)){
 | 
	
		
			
				|  |  |        foreach ($disabled_instances as $disabled_field) {
 | 
	
	
		
			
				|  | @@ -380,8 +387,7 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
 | 
	
		
			
				|  |  |      $record->settings = $settings;
 | 
	
		
			
				|  |  |      drupal_write_record('ds_layout_settings', $record);
 | 
	
		
			
				|  |  |      // Clear the Drpual chace
 | 
	
		
			
				|  |  | -    cache_clear_all();
 | 
	
		
			
				|  |  | -    watchdog('debug', '<pre>$record: '. print_r($record, TRUE) .'</pre>');
 | 
	
		
			
				|  |  | +    drupal_flush_all_caches();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    catch (Exception $e) {
 | 
	
		
			
				|  |  |      watchdog_exception('tripal_ds', $e);
 |