From 0ee68a3351b1590e875dd1b384efc556486c9aa4 Mon Sep 17 00:00:00 2001 From: Chuck Adams Date: Tue, 9 Jun 2026 23:19:37 -0600 Subject: [PATCH 1/2] Backport: pick_release use reset() ?: null to avoid TypeError on empty releases Signed-off-by: Chuck Adams --- inc/packages/namespace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/packages/namespace.php b/inc/packages/namespace.php index 3918688a..12793a22 100644 --- a/inc/packages/namespace.php +++ b/inc/packages/namespace.php @@ -346,7 +346,7 @@ function pick_release( array $releases, ?string $version = null ) : ?ReleaseDocu // If no version is specified, return the latest release. if ( empty( $version ) ) { - return reset( $releases ); + return reset( $releases ) ?: null; } return array_find( $releases, fn ( $release ) => $release->version === $version ); From a71328dc51a4250307133fcdb6d2f7ea1b5a87f7 Mon Sep 17 00:00:00 2001 From: Chuck Adams Date: Tue, 9 Jun 2026 23:22:43 -0600 Subject: [PATCH 2/2] allow config override of hardwired plc.directory Signed-off-by: Chuck Adams --- inc/packages/namespace.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/packages/namespace.php b/inc/packages/namespace.php index 12793a22..5258ebfc 100644 --- a/inc/packages/namespace.php +++ b/inc/packages/namespace.php @@ -35,7 +35,10 @@ function get_plc_client(): PlcClient { static $client; if ( ! $client ) { - $client = new PlcClient(); + $base_url = defined( 'FAIR_PLC_DIRECTORY_URL' ) + ? FAIR_PLC_DIRECTORY_URL + : 'https://plc.directory'; + $client = new PlcClient( $base_url ); } return $client; }