Cannot redeclare Drupal\moderation_note\Entity\ModerationNote::toUrl() in /opt/drupal/web/modules/contrib/moderation_note/src/Entity/ModerationNote.php on line 412

Created on 25 November 2024, about 1 month ago

When deploying after 8.x-1.0-beta6 (23 Nov 2024), receive Fatal error: Cannot redeclare Drupal\moderation_note\Entity\ModerationNote::toUrl() in /opt/drupal/web/modules/contrib/moderation_note/src/Entity/ModerationNote.php on line 412

When I cat the file I see the toURL function is declared twice:

/**
* {@inheritdoc}
*/
public function toUrl($rel = 'canonical', array $options = []) {
$entity = $this->getModeratedEntity();
$options['query']['open-moderation-note'] = $this->id();
$url = $entity->toUrl('canonical', $options);

return $url;
}

/**
* {@inheritdoc}
*/
public function toUrl($rel = 'canonical', array $options = []) {
try {
$url = parent::toUrl($rel, $options);
}
catch (UndefinedLinkTemplateException $e) {
return '';
}

return $url;
}

🐛 Bug report
Status

Active

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024