Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/ccmnet/ccmnet.module
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ function ccmnet_entity_field_access($operation, \Drupal\Core\Field\FieldDefiniti
$allowed_roles = ['administrator', 'ccmnet_pm', 'champions_mentorship_admin'];
$user_roles = $account->getRoles();
$has_access = !empty(array_intersect($allowed_roles, $user_roles));

if (!$has_access) {
return \Drupal\Core\Access\AccessResult::forbidden()->addCacheContexts(['user.roles']);
}
}
}

return \Drupal\Core\Access\AccessResult::neutral();
}

Expand Down Expand Up @@ -921,7 +921,7 @@ function ccmnet_cron() {
$author = $node->getOwner()->getEmail();
$options = ['absolute' => FALSE];
$here = Url::fromRoute('entity.node.canonical', ['node' => $interested_nid], $options);
$link = 'https://ccmnet.org' . $here->toString(TRUE)->getGeneratedUrl();
$link = $here->toString(TRUE)->getGeneratedUrl();
$node_title = $node->getTitle();
$mentorship_program = $node->get('field_mentorship_program')->getString();
if ($mentorship_program == 910) {
Expand Down