From 268a23fcc5800eef38a50cd24295183a52b1f568 Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Fri, 15 Nov 2024 11:27:19 -0800 Subject: [PATCH] Encode solr file contents if is json --- .../src/Form/PantheonSolrAdminForm.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/search_api_pantheon_admin/src/Form/PantheonSolrAdminForm.php b/modules/search_api_pantheon_admin/src/Form/PantheonSolrAdminForm.php index 6773cbdc..709e1cc7 100644 --- a/modules/search_api_pantheon_admin/src/Form/PantheonSolrAdminForm.php +++ b/modules/search_api_pantheon_admin/src/Form/PantheonSolrAdminForm.php @@ -79,6 +79,10 @@ public function buildForm( '#group' => 'status', '#weight' => substr($filename, 0, -3) === 'xml' ? -10 : 10, ]; + + if ( ! is_string($file_contents)) { + $file_contents = json_encode($file_contents); + } $form[$filename][] = $this->getViewSolrFile($filename, $file_contents, $is_open); $is_open = FALSE; }