1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00

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
This commit is contained in:
epriestley 2014-12-11 11:10:52 -08:00
parent a2126631f3
commit bc5598865f

View file

@ -67,6 +67,12 @@ final class PhabricatorApplicationTransactionResponse
$xactions = mpull($view->buildEvents(), 'render', 'getTransactionPHID'); $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( $content = array(
'xactions' => $xactions, 'xactions' => $xactions,
'spacer' => PHUITimelineView::renderSpacer(), 'spacer' => PHUITimelineView::renderSpacer(),