From f42dd5819e98c4ff1adc73c22b5f79b42c475538 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 16 Nov 2023 10:41:43 +0100 Subject: [PATCH] Fix possible array to string conversion renaming Pholio Mockup image Summary: Premising that the `$old` and `$new` variables are 1-element arrays defined as PHID=>title, this can cause `renderValue()` repeatedly fail when passing an array instead of its value. Thus pass `head($old)` instead, to get the first value - that is the only one, even if you rename multiple images (since this Transaction is about a single Mockup image). Closes T15646 Test Plan: * Have `phd` running * Create a Pholio mockup with at least one image Edit the Pholio mockup and: 1. rename the Titles of an image 2. rename a single Image 3. rename no image No nuclear implosions. You still see a lovely Feed mentioning each rename. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15646 Differential Revision: https://we.phorge.it/D25441 --- .../pholio/xaction/PholioImageNameTransaction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/pholio/xaction/PholioImageNameTransaction.php b/src/applications/pholio/xaction/PholioImageNameTransaction.php index 33b01903ee..f4705a98fc 100644 --- a/src/applications/pholio/xaction/PholioImageNameTransaction.php +++ b/src/applications/pholio/xaction/PholioImageNameTransaction.php @@ -31,8 +31,8 @@ final class PholioImageNameTransaction '%s renamed an image (%s) from %s to %s.', $this->renderAuthor(), $this->renderHandle(key($new)), - $this->renderValue($old), - $this->renderValue($new)); + $this->renderValue((string)head($old)), + $this->renderValue((string)head($new))); } public function getTitleForFeed() {