From bc5598865f62d4ddd3be8521f07850238b967011 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 11 Dec 2014 11:10:52 -0800 Subject: [PATCH] Fix a stray comma on File previews Summary: There's a comma to the lower-left of my profile picture here: {F248962} This is on a page like https://secure.phabricator.com/F248948 What's happening is that some `render()` method is returning a valid result like `array($stuff, null)`. This is getting passed to JS as an array, which is implicitly `join()`'ing it into a string, adding a comma. Instead, make sure we render these to strings on the server side before shipping them to the client. Test Plan: No more comma on file previews. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10974 --- .../response/PhabricatorApplicationTransactionResponse.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php b/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php index 7d4066cfda..a83aa1823f 100644 --- a/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php +++ b/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php @@ -67,6 +67,12 @@ final class PhabricatorApplicationTransactionResponse $xactions = mpull($view->buildEvents(), 'render', 'getTransactionPHID'); } + // Force whatever the underlying views built to render into HTML for + // the Javascript. + foreach ($xactions as $key => $xaction) { + $xactions[$key] = hsprintf('%s', $xaction); + } + $content = array( 'xactions' => $xactions, 'spacer' => PHUITimelineView::renderSpacer(),