Browse Source

Updated to fix problem with passing a string to the drupal_alter funciont

Stephen Ficklin 4 years ago
parent
commit
ff8e4d4374
2 changed files with 12 additions and 8 deletions
  1. 6 4
      tripal/api/tripal.entities.api.inc
  2. 6 4
      tripal/includes/tripal.admin_blocks.inc

+ 6 - 4
tripal/api/tripal.entities.api.inc

@@ -645,8 +645,9 @@ function tripal_tripal_cron_notification() {
     $modules = module_implements('bundle_fields_info');
     foreach ($modules as $module) {
       $function = $module . '_bundle_fields_info';
-      $info = $function('TripalEntity', $bundle);
-      drupal_alter('bundle_fields_info', $info, 'TripalEntity', $bundle);
+      $entity_type = 'TripalEntity';
+      $info = $function($entity_type, $bundle);
+      drupal_alter('bundle_fields_info', $info, $entity_type, $bundle);
       foreach ($info as $field_name => $details) {
 
         // If the field already exists then skip it.
@@ -671,8 +672,9 @@ function tripal_tripal_cron_notification() {
     $modules = module_implements('bundle_instances_info');
     foreach ($modules as $module) {
       $function = $module . '_bundle_instances_info';
-      $info = $function('TripalEntity', $bundle);
-      drupal_alter('bundle_instances_info', $info, 'TripalEntity', $bundle);
+      $entity_type = 'TripalEntity';
+      $info = $function($entity_type, $bundle);
+      drupal_alter('bundle_instances_info', $info, $entity_type, $bundle);
       foreach ($info as $field_name => $details) {
 
         // If the field is already attached to this bundle then skip it.

+ 6 - 4
tripal/includes/tripal.admin_blocks.inc

@@ -26,8 +26,9 @@ function tripal_admin_notification_import_field($field_name_note, $bundle_id, $m
 
   if ($field_or_instance == 'field') {
     $function = $module . '_bundle_fields_info';
-    $info = $function('TripalEntity', $bundle);
-    drupal_alter('bundle_fields_info', $info, 'TripalEntity', $bundle);
+    $entity_type = 'TripalEntity';
+    $info = $function($entity_type, $bundle);
+    drupal_alter('bundle_fields_info', $info, $entity_type, $bundle);
     foreach ($info as $field_name => $details) {
       $field = field_info_field($field_name);
       if ($details['field_name'] == $field_name_note) {
@@ -45,8 +46,9 @@ function tripal_admin_notification_import_field($field_name_note, $bundle_id, $m
   else {
     if ($field_or_instance == 'instance') {
       $function = $module . '_bundle_instances_info';
-      $info = $function('TripalEntity', $bundle);
-      drupal_alter('_bundle_instances_info', $info, 'TripalEntity', $bundle);
+      $entity_type = 'TripalEntity';
+      $info = $function($entity_type, $bundle);
+      drupal_alter('_bundle_instances_info', $info, $entity_type, $bundle);
       foreach ($info as $field_name => $details) {
         if ($details['field_name'] == $field_name_note) {
           // Create the field instance.