Skip to content

Commit

Permalink
Merge pull request #63 from muskie9/pull/legacyStrtoupperDeprecation
Browse files Browse the repository at this point in the history
BUGFIX strtoupper null value deprecation
  • Loading branch information
muskie9 authored Oct 5, 2022
2 parents 1ce7d7c + 821ad09 commit 572f52e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/AddressDataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public function updateCMSFields(FieldList $fields)
$overrideField->setDescription('Check this box and save to be able to edit the latitude and longitude manually.');

if ($this->owner->Lng && $this->owner->Lat) {
$googleMapURL = 'https://maps.google.com/?q='.$this->owner->Lat.','.$this->owner->Lng;
$googleMapDiv = '<div class="field"><label class="left" for="Form_EditForm_MapURL_Readonly">Google Map</label><div class="middleColumn"><a href="'.$googleMapURL.'" target="_blank">'.$googleMapURL.'</a></div></div>';
$googleMapURL = 'https://maps.google.com/?q=' . $this->owner->Lat . ',' . $this->owner->Lng;
$googleMapDiv = '<div class="field"><label class="left" for="Form_EditForm_MapURL_Readonly">Google Map</label><div class="middleColumn"><a href="' . $googleMapURL . '" target="_blank">' . $googleMapURL . '</a></div></div>';
$compositeField->push(LiteralField::create('MapURL_Readonly', $googleMapDiv));
}
if ($this->owner->LatLngOverride) {
Expand All @@ -94,9 +94,12 @@ public function getFullAddress()
$this->owner->City,
$this->owner->State,
$this->owner->PostalCode,
strtoupper($this->owner->Country),
];

if ($this->owner->Country !== null) {
$parts[] = strtoupper($this->owner->Country);
}

return implode(', ', array_filter($parts));
}

Expand Down Expand Up @@ -190,8 +193,8 @@ public static function getMapStyleJSON()

/**
* Gets the maker icon image
* @var boolean $svg if svgs should be included
* @return null|string
* @var boolean $svg if svgs should be included
*/
public static function getIconImage($svg = true)
{
Expand Down

0 comments on commit 572f52e

Please sign in to comment.