From eefd274b764ab878adee6e55f0ca8057bd301fdc Mon Sep 17 00:00:00 2001 From: Cody Reichert Date: Fri, 18 May 2018 11:11:20 -0500 Subject: [PATCH] Fix buildDetailsLink function in utils For some reason the ternary operation for conditionally inserting a comma can't be used directly in the string concatenation. So this moves it out into it's own variable. --- simply-rets-utils.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/simply-rets-utils.php b/simply-rets-utils.php index 876bb1f..ef4b433 100644 --- a/simply-rets-utils.php +++ b/simply-rets-utils.php @@ -77,14 +77,14 @@ public static function buildDetailsLink($listing, $params = array()) { $listing_zip = $listing->address->postalCode; $listing_address = $listing->address->full; + // A listing might not have a null address if a flag like + // "Display address" is set to false. This just removes the + // comma in these cases, but the rest of the address remains + // the same. + $comma = $listing_address ? ', ' : ''; + $listing_address_full = $listing_address - // A listing might not have a null - // address if a flag like "Display - // address" is set to false. This just - // removes the comma in these cases, but - // the rest of the address remains the - // same. - . $listing_address ? ', ' : '' + . $comma . $listing_city . ', ' . $listing_state