Skip to content

Commit

Permalink
Check if field exists on person entity
Browse files Browse the repository at this point in the history
  • Loading branch information
trackleft committed Dec 12, 2024
1 parent 372eeaf commit 287cda4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions modules/custom/az_person/src/AZUserToolbarLinkBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ public function __construct(
public function renderToolbarLinks() {
$build = parent::renderToolbarLinks();
$additional_links = [];

// Only valid if we have the externalauth module.
if (!empty($this->authmap)) {
// Check if we have permission.
if ($this->account->hasPermission('edit matching netid content')) {
$auth = $this->authmap->get($this->account->id(), 'cas');

if (($auth !== FALSE)) {
// Verify that 'field_az_netid' exists for 'az_person' content type.
$field_definitions = $this->entityFieldManager->getFieldDefinitions('node', 'az_person');
Expand All @@ -85,7 +83,6 @@ public function renderToolbarLinks() {
'type' => 'az_person',
'status' => [1, TRUE],
]);

if (!empty($persons)) {
$person = reset($persons);
// If we have a linked az person, generate links.
Expand Down

0 comments on commit 287cda4

Please sign in to comment.