Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
brandonkelly committed Sep 6, 2024
2 parents 11c099d + 00741f2 commit fadf48f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixed styling issues with Template field layout UI elements’ selector labels.
- Fixed a validation error that could occur when saving a relational field, if the “Maintain hierarchy” setting had been enabled but was no longer applicable. ([#15666](https://github.com/craftcms/cms/issues/15666))
- Fixed a bug where formatted addresses weren’t using the application locale consistently. ([#15668](https://github.com/craftcms/cms/issues/15668))
- Fixed a bug where Tip and Warning field layout UI elements would display in field layouts even if they had no content. ([#15681](https://github.com/craftcms/cms/issues/15681))
- Fixed a PHP error that occurred when running PHP 8.2 or 8.3.
- Fixed a bug where disabled entries became enabled when edited within Live Preview. ([#15670](https://github.com/craftcms/cms/issues/15670))
- Fixed a bug where new nested entries could get incremented slugs even if there were no elements with conflicting URIs. ([#15672](https://github.com/craftcms/cms/issues/15672))
Expand Down
10 changes: 8 additions & 2 deletions src/fieldlayoutelements/Tip.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class Tip extends BaseUiElement
*/
protected function selectorLabel(): string
{
if ($this->tip) {
$tip = trim($this->tip);
if ($tip !== '') {
return $this->tip;
}

return $this->_isTip() ? Craft::t('app', 'Tip') : Craft::t('app', 'Warning');
}

Expand Down Expand Up @@ -97,6 +97,12 @@ protected function settingsHtml(): ?string
*/
public function formHtml(?ElementInterface $element = null, bool $static = false): ?string
{
$tip = trim($this->tip);

if ($tip === '') {
return null;
}

if (!$this->uid) {
$this->dismissible = false;
}
Expand Down

0 comments on commit fadf48f

Please sign in to comment.