Skip to content

Commit

Permalink
#10 rename study_datapackage_uuid to datapackage_uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
p-a-s-c-a-l committed Aug 29, 2019
1 parent 61347ac commit ef8681f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions csis_helpers.module
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ function csis_js_alter(&$javascript, \Drupal\Core\Asset\AttachedAssetsInterface
}



/**
* Extract information from **node** entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* @return void
*/
function csis_helpers_node_entity_info(\Drupal\Core\Entity\EntityInterface $entity){
$groupid = array();
$groupuuid = array();
Expand Down Expand Up @@ -108,7 +113,7 @@ function csis_helpers_node_entity_info(\Drupal\Core\Entity\EntityInterface $enti
'study'=> (empty($groupid)? 0 : $groupid[0]),
'study_uuid' => (empty($groupuuid)? 0 : $groupuuid[0]),
'study_emikat_id' => $groupEmikatID,
'study_datapackage_uuid' => $datapackageUUID,
'datapackage_uuid' => $datapackageUUID,
'study_area' => $groupArea,
'eea_city_name' => $groupEeaName,
'write_permissions' => ($has_user_special_roles ? 0 : 1)
Expand All @@ -117,7 +122,9 @@ function csis_helpers_node_entity_info(\Drupal\Core\Entity\EntityInterface $enti
}

/**
* sets for each Study group the $entityifno variable
* sets for each Study group the $entityInfo variable
* Extract information from **group** entity.
*/
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* @return void
Expand All @@ -127,7 +134,7 @@ function csis_helpers_group_entity_info(\Drupal\Core\Entity\EntityInterface $ent
if ($entity->getGroupType()->id() == "study") {
$datapackageUUID = null;
$eeaName = null;
// Load the tdata package
// Load the data package
$groupDatapackageID = $entity->get('field_data_package')->target_id;
if ($groupDatapackageID) {
$datapackageNode = \Drupal\node\Entity\Node::load($groupDatapackageID);
Expand All @@ -150,7 +157,7 @@ function csis_helpers_group_entity_info(\Drupal\Core\Entity\EntityInterface $ent
'study'=> $entity->id(),
'study_uuid'=> $entity->uuid(),
'study_emikat_id' => $entity->get('field_emikat_id')->value,
'study_datapackage_uuid' => $datapackageUUID,
'datapackage_uuid' => $datapackageUUID,
'study_area' => $entity->get('field_area')->value,
'eea_city_name' => $eeaName,
'write_permissions' => ($has_user_special_roles ? 0 : 1)
Expand Down

0 comments on commit ef8681f

Please sign in to comment.