From f50d3e3caff7d04f787ed9e05229f01a64111d38 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Tue, 4 Feb 2025 12:12:39 +0100 Subject: [PATCH] Test fix --- tests/CPClientTest.php | 3 +++ www/templates/layouts/includes/wpt-header.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/CPClientTest.php b/tests/CPClientTest.php index 3c6f838301..2e0ea77eae 100644 --- a/tests/CPClientTest.php +++ b/tests/CPClientTest.php @@ -301,6 +301,9 @@ public function testGetUser(): void "status": "ACTIVE", "vatNumber": null } + "wptIsPreviewEnabled": { + "enabled": false + } } }'); $host = "http://webpagetest.org"; diff --git a/www/templates/layouts/includes/wpt-header.php b/www/templates/layouts/includes/wpt-header.php index f990501a43..b14dc64ed1 100644 --- a/www/templates/layouts/includes/wpt-header.php +++ b/www/templates/layouts/includes/wpt-header.php @@ -50,7 +50,7 @@ function addTab($tabName, $tabUrl, $addClass = '') $is_logged_in = Util::getSetting('cp_auth') && (!is_null($request_context)) && (!is_null($request_context->getClient()) && $request_context->getClient()->isAuthenticated()); $user = !is_null($request_context) ? $request_context->getUser() : null; -if ($request_context->isReadOnly()) { +if (isset($request_context) && $request_context->isReadOnly()) { ?>