Skip to content

Commit

Permalink
Render default text before auto text. Bump to 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Feb 18, 2024
1 parent 0ff87be commit 3692f38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Release Notes for LinkMate

## 2.5.1 - 2024-02-18
### Fixed
- Fixes an issue where Link fields' default text would, realistically, never render

## 2.5.0.1 - 2023-10-20
### Fixed
- Fix exception that could be thrown when getting search keywords for link fields

## 2.5.0 - 2023-10-19
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vaersaagod/linkmate",
"description": "Let's hook you up, mate!",
"type": "craft-plugin",
"version": "2.5.0.1",
"version": "2.5.1",
"keywords": [
"craft",
"cms",
Expand Down
9 changes: 4 additions & 5 deletions src/models/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,12 @@ public function getText(): ?string
return $this->customText;
}

$linkText = $this->getLinkType()?->getText($this);

if (!empty($linkText)) {
return $linkText;
$defaultText = Craft::t('site', $this->getDefaultText());
if (!empty($defaultText)) {
return $defaultText;
}

return Craft::t('site', $this->getDefaultText());
return $this->getLinkType()?->getText($this);
}

/**
Expand Down

0 comments on commit 3692f38

Please sign in to comment.