Skip to content

Commit

Permalink
Fix buildDetailsLink function in utils
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CodyReichert committed May 18, 2018
1 parent 8b2b0fe commit eefd274
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions simply-rets-utils.php
Expand Up @@ -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
Expand Down

0 comments on commit eefd274

Please sign in to comment.