Browse Source

Revert "Fix inconsistensies with cached fieldS"

This reverts commit 41676e1e4a18911b4c1b628f28b509b901ad9ca4.
Abdullah Almsaeed 6 years ago
parent
commit
015ad834ba

+ 2 - 2
tripal/tripal.module

@@ -1526,7 +1526,7 @@ function tripal_field_display_TripalEntity_alter(&$display, $context){
   // is set to TRUE for this bundle and ajax load is turned off.
   $hide_variable = tripal_get_bundle_variable('hide_empty_field', $bundle_info->id);
   $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
-  if($hide_variable == TRUE){
+  if($hide_variable == TRUE && $ajax_field == FALSE){
     $item = field_get_items('TripalEntity', $context['entity'], $field_name);
     if($item) {
       $field = field_info_field($field_name);
@@ -1560,7 +1560,7 @@ function tripal_field_group_table_rows_alter(&$element, &$children) {
       // then remove fields from the field group.
       $hide_variable = tripal_get_bundle_variable('hide_empty_field', $bundle_info->id);
       $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
-      if($hide_variable == TRUE){
+      if($hide_variable == TRUE && $ajax_field == FALSE){
         $items = $element[$child]['#items'];
         // Case #1: there are no items.
         if (count($items) == 0) {

+ 1 - 1
tripal_ds/tripal_ds.module

@@ -471,7 +471,7 @@ function tripal_ds_field_display_alter(&$display, $context){
     $ajax_variable = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
 
 
-    if ($field_name && ($hide_variable == TRUE)) {
+    if ($field_name && ($hide_variable == TRUE) && ($ajax_variable == FALSE)) {
       $item = field_get_items('TripalEntity', $context['entity'], $field_name);
       $field = field_info_field($field_name);
       if ($item) {

+ 6 - 6
tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

@@ -249,8 +249,8 @@ class TripalContentService_v0_1 extends TripalWebService {
     // If the entity is set to hide fields that have no values then we
     // want to honor that in the web services too.
     $hide_fields = tripal_get_bundle_variable('hide_empty_field', $bundle->id);
-    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle->id);
-    // If ajax is turned off the hide fields functionality will be handled by
+    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
+    // If ajax is turned off the hide fields functionality will be handled by 
     // javascript so change the $hide_fields variable to false to avoid any actions.
     if ($ajax_field == TRUE) {
       $hide_fields = FALSE;
@@ -346,8 +346,8 @@ class TripalContentService_v0_1 extends TripalWebService {
     // If the entity is set to hide fields that have no values then we
     // want to honor that in the web services too.
     $hide_fields = tripal_get_bundle_variable('hide_empty_field', $bundle->id);
-    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle->id);
-    // If ajax is turned off the hide fields functionality will be handled by
+    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
+    // If ajax is turned off the hide fields functionality will be handled by 
     // javascript so change the $hide_fields variable to false to avoid any actions.
     if ($ajax_field == TRUE) {
       $hide_fields = FALSE;
@@ -448,8 +448,8 @@ class TripalContentService_v0_1 extends TripalWebService {
     // If the entity is set to hide fields that have no values then we
     // want to honor that in the web services too.
     $hide_fields = tripal_get_bundle_variable('hide_empty_field', $bundle->id);
-    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle->id);
-    // If ajax is turned off the hide fields functionality will be handled by
+    $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
+    // If ajax is turned off the hide fields functionality will be handled by 
     // javascript so change the $hide_fields variable to false to avoid any actions.
     if ($ajax_field == TRUE) {
       $hide_fields = FALSE;