Skip to content

Commit 0592574

Browse files
committed
Fixed #18632
1 parent 75d1f49 commit 0592574

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Fixed a bug where nested elements would get soft-deleted after running the `entrify/global-set` command. ([#18650](https://github.com/craftcms/cms/issues/18650))
1717
- Fixed a bug where the “Max Authors” section setting was visible for Single sections.
1818
- Fixed an exception that would be thrown when attempting to access undefined keys within `craft\fields\data\JsonData` objects from Twig. ([#18656](https://github.com/craftcms/cms/issues/18656))
19+
- Fixed a bug where address cards could be missing their address preview. ([#18632](https://github.com/craftcms/cms/issues/18632))
1920

2021
## 5.9.18 - 2026-03-26
2122

src/elements/Address.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use craft\fieldlayoutelements\addresses\OrganizationTaxIdField;
2222
use craft\fieldlayoutelements\BaseNativeField;
2323
use craft\fieldlayoutelements\FullNameField;
24+
use craft\helpers\Html;
2425
use craft\models\FieldLayout;
2526
use craft\records\Address as AddressRecord;
2627
use craft\validators\StringValidator;
@@ -127,13 +128,26 @@ protected static function defineTableAttributes(): array
127128
]);
128129
}
129130

131+
/**
132+
* @inheritdoc
133+
*/
134+
protected static function defineDefaultCardAttributes(): array
135+
{
136+
return [
137+
'address',
138+
];
139+
}
130140

131141
/**
132142
* @inheritdoc
133143
*/
134144
protected function attributeHtml(string $attribute): string
135145
{
136146
switch ($attribute) {
147+
case 'address':
148+
return Html::tag('div', Craft::$app->getAddresses()->formatAddress($this), [
149+
'class' => 'no-truncate',
150+
]);
137151
case 'country':
138152
return $this->getCountry()->getName();
139153
default:

0 commit comments

Comments
 (0)