From 0c9266d442ee2eb71ed8783077b8957808d4f7b8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 11 Dec 2023 08:59:31 +0100 Subject: [PATCH 01/41] allow Twig 4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2de2677c..a96f7fcb 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "symfony/http-kernel": "^6.4|^7.0", "symfony/routing": "^6.4|^7.0", "symfony/twig-bundle": "^6.4|^7.0", - "twig/twig": "^3.0.4" + "twig/twig": "^3.0.4|^4.0" }, "require-dev": { "symfony/browser-kit": "^6.4|^7.0", From f5a3844849416de448af5c9f6a2f49afb6f6bf30 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Wed, 27 Dec 2023 13:57:19 +0100 Subject: [PATCH 02/41] DX: re-apply CS --- Tests/Profiler/CodeExtensionTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Profiler/CodeExtensionTest.php b/Tests/Profiler/CodeExtensionTest.php index e10c01f6..8a2c88a3 100644 --- a/Tests/Profiler/CodeExtensionTest.php +++ b/Tests/Profiler/CodeExtensionTest.php @@ -116,7 +116,6 @@ public function testFormatArgsIntegration() $this->assertEquals($expected, $this->render($template, $data)); } - public function testFormatFileIntegration() { $template = <<<'TWIG' From 26418fe953cd8f700d271be7d06e626cb67ab8d5 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Tue, 2 Jan 2024 15:49:33 +0100 Subject: [PATCH 03/41] CS: trailing commas --- Tests/DependencyInjection/WebProfilerExtensionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/DependencyInjection/WebProfilerExtensionTest.php b/Tests/DependencyInjection/WebProfilerExtensionTest.php index 3ec1756d..ecc32333 100644 --- a/Tests/DependencyInjection/WebProfilerExtensionTest.php +++ b/Tests/DependencyInjection/WebProfilerExtensionTest.php @@ -158,7 +158,7 @@ public function testToolbarConfigUsingInterceptRedirects( bool $toolbarEnabled, bool $interceptRedirects, bool $listenerInjected, - bool $listenerEnabled + bool $listenerEnabled, ) { $extension = new WebProfilerExtension(); $extension->load( From ad3b356447ba131106c10da72407f7b62b750079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=BCnter?= Date: Fri, 8 Dec 2023 12:48:20 -0500 Subject: [PATCH 04/41] [WebProfilerBundle] Set `XDEBUG_IGNORE` option for all XHR --- CHANGELOG.md | 5 +++++ Resources/views/Profiler/toolbar_js.html.twig | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a2d8c8..f1cb8328 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.1 +--- + + * Set `XDEBUG_IGNORE` query parameter when sending toolbar XHR + 6.4 --- diff --git a/Resources/views/Profiler/toolbar_js.html.twig b/Resources/views/Profiler/toolbar_js.html.twig index 90f254c1..74edcf6e 100644 --- a/Resources/views/Profiler/toolbar_js.html.twig +++ b/Resources/views/Profiler/toolbar_js.html.twig @@ -78,6 +78,9 @@ } var request = function(url, onSuccess, onError, payload, options, tries) { + url = new URL(url); + url.searchParams.set('XDEBUG_IGNORE', '1'); + url = url.toString(); var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); options = options || {}; options.retry = options.retry || false; From d4733b332e5e730347fc68f49c8c6b1c4056334f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Feb 2024 15:51:36 +0100 Subject: [PATCH 05/41] [WebProfilerBundle] Allow to search inside profiler tables --- Resources/views/Profiler/bag.html.twig | 2 + Resources/views/Profiler/base_js.html.twig | 51 ++++++++++++++++++++++ Resources/views/Profiler/profiler.css.twig | 23 ++++++++++ Resources/views/Profiler/table.html.twig | 2 + 4 files changed, 78 insertions(+) diff --git a/Resources/views/Profiler/bag.html.twig b/Resources/views/Profiler/bag.html.twig index 4df5ccf1..d66697ff 100644 --- a/Resources/views/Profiler/bag.html.twig +++ b/Resources/views/Profiler/bag.html.twig @@ -1,3 +1,4 @@ +
@@ -18,3 +19,4 @@ {% endfor %}
+
diff --git a/Resources/views/Profiler/base_js.html.twig b/Resources/views/Profiler/base_js.html.twig index 8a669a5c..8841dd7a 100644 --- a/Resources/views/Profiler/base_js.html.twig +++ b/Resources/views/Profiler/base_js.html.twig @@ -12,6 +12,7 @@ class SymfonyProfiler { constructor() { this.#createTabs(); + this.#createTableSearchFields(); this.#createToggles(); this.#createCopyToClipboard(); this.#convertDateTimesToUserTimezone(); @@ -105,6 +106,56 @@ }); } + #createTableSearchFields() { + document.querySelectorAll('div.table-with-search-field').forEach((tableWrapper, i) => { + const searchField = document.createElement('input'); + searchField.type = 'search'; + searchField.placeholder = 'search...'; + searchField.id = `table-search-field-${i}`; + searchField.classList.add(`table-search-field-input`); + searchField.autocapitalize = 'off'; + searchField.autocomplete = 'off'; + searchField.autocorrect = 'off'; + tableWrapper.insertBefore(searchField, tableWrapper.firstChild); + + const labelField = document.createElement('label'); + labelField.htmlFor = `table-search-field-${i}`; + labelField.classList.add(`table-search-field-label`); + labelField.textContent = 'Search inside the contents of the table'; + tableWrapper.insertBefore(labelField, tableWrapper.firstChild); + + searchField.addEventListener('input', () => { + const query = searchField.value.toLowerCase(); + let allRowsAreHidden = true; + tableWrapper.querySelectorAll('tbody tr').forEach((row) => { + const rowMatchesQuery = row.textContent.toLowerCase().includes(query); + row.style.display = rowMatchesQuery ? '' : 'none'; + + if (rowMatchesQuery) { + allRowsAreHidden = false; + } + }); + + /* if there are no results and all rows are hidden, show a message to avoid confusion */ + const noResultsElement = tableWrapper.querySelector('.no-results-message'); + if (allRowsAreHidden) { + if (null === noResultsElement) { + const noResultsElement = document.createElement('p'); + noResultsElement.textContent = 'No results found.'; + noResultsElement.classList.add('no-results-message'); + tableWrapper.appendChild(noResultsElement); + } else { + noResultsElement.style.display = ''; + } + } else { + if (null !== noResultsElement) { + noResultsElement.style.display = 'none'; + } + } + }); + }); + } + #createToggles() { const toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])'); toggles.forEach((toggle) => { diff --git a/Resources/views/Profiler/profiler.css.twig b/Resources/views/Profiler/profiler.css.twig index 33494656..cc87aae4 100644 --- a/Resources/views/Profiler/profiler.css.twig +++ b/Resources/views/Profiler/profiler.css.twig @@ -614,6 +614,29 @@ table tbody td.num-col { text-align: center; } +div.table-with-search-field { + position: relative; +} +div.table-with-search-field label.table-search-field-label { + display: none; +} +div.table-with-search-field input.table-search-field-input { + position: absolute; + right: 5px; + top: 5px; + max-height: 27px; /* needed for Safari */ +} +div.table-with-search-field .no-results-message { + background: var(--page-background); + border: solid var(--table-border-color); + border-width: 0 1px 1px; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + font-size: var(--table-font-size); + margin-top: -1em; + padding: 15px 10px; +} + {# Utility classes ========================================================================= #} .block { diff --git a/Resources/views/Profiler/table.html.twig b/Resources/views/Profiler/table.html.twig index cb9986bd..e8ffcb02 100644 --- a/Resources/views/Profiler/table.html.twig +++ b/Resources/views/Profiler/table.html.twig @@ -1,3 +1,4 @@ +
@@ -14,3 +15,4 @@ {% endfor %}
+
From 5c920b76a5b362c65ad72946c6fdaf17acd7c595 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 21 Mar 2024 10:52:12 +0100 Subject: [PATCH 06/41] [WebProfilerBundle] [WebProfilerPanel] Update the design of the workflow profiler panel --- Resources/views/Collector/workflow.html.twig | 61 ++++++++++++-------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/Resources/views/Collector/workflow.html.twig b/Resources/views/Collector/workflow.html.twig index 377b74f6..4a0d9f95 100644 --- a/Resources/views/Collector/workflow.html.twig +++ b/Resources/views/Collector/workflow.html.twig @@ -3,7 +3,15 @@ {% block stylesheets %} {{ parent() }} + {# CAUTION: the contents of this file are processed by Twig before loading them as JavaScript source code. Always use '/*' comments instead diff --git a/Tests/Controller/ProfilerControllerTest.php b/Tests/Controller/ProfilerControllerTest.php index 0e4e9e0d..3933d30e 100644 --- a/Tests/Controller/ProfilerControllerTest.php +++ b/Tests/Controller/ProfilerControllerTest.php @@ -137,6 +137,33 @@ public function testToolbarActionWithEmptyToken($token) $this->assertEquals(200, $response->getStatusCode()); } + public function testToolbarStylesheetActionWithProfilerDisabled() + { + $urlGenerator = $this->createMock(UrlGeneratorInterface::class); + $twig = $this->createMock(Environment::class); + + $controller = new ProfilerController($urlGenerator, null, $twig, []); + + $this->expectException(NotFoundHttpException::class); + $this->expectExceptionMessage('The profiler must be enabled.'); + + $controller->toolbarStylesheetAction(); + } + + public function testToolbarStylesheetAction() + { + $urlGenerator = $this->createMock(UrlGeneratorInterface::class); + $twig = $this->createMock(Environment::class); + $profiler = $this->createMock(Profiler::class); + + $controller = new ProfilerController($urlGenerator, $profiler, $twig, []); + + $response = $controller->toolbarStylesheetAction(); + $this->assertSame(200, $response->getStatusCode()); + $this->assertSame('text/css', $response->headers->get('Content-Type')); + $this->assertSame('max-age=600, private', $response->headers->get('Cache-Control')); + } + public static function getEmptyTokenCases() { return [ From 1827c2cf600a760334b4fbbc610a9fe308a3f73a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 23 Oct 2024 10:11:04 +0200 Subject: [PATCH 30/41] revert allowing Twig 4 As Twig 4 will not be released before Symfony 7.2 we should not claim compatibility before a stable Twig 4 release. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 22752414..ce94b4b6 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "symfony/http-kernel": "^6.4|^7.0", "symfony/routing": "^6.4|^7.0", "symfony/twig-bundle": "^6.4|^7.0", - "twig/twig": "^3.12|^4.0" + "twig/twig": "^3.12" }, "require-dev": { "symfony/browser-kit": "^6.4|^7.0", From fcf20a190a795f59361920d0d125a037f5283593 Mon Sep 17 00:00:00 2001 From: Mathieu Santostefano Date: Thu, 31 Oct 2024 15:05:51 +0100 Subject: [PATCH 31/41] Re-add missing Profiler shortcuts on Profiler homepage --- Resources/views/Profiler/results.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Resources/views/Profiler/results.html.twig b/Resources/views/Profiler/results.html.twig index d97de65c..d4f6ff86 100644 --- a/Resources/views/Profiler/results.html.twig +++ b/Resources/views/Profiler/results.html.twig @@ -35,7 +35,9 @@ {% endblock %} {% block sidebar_search_css_class %}{% endblock %} -{% block sidebar_shortcuts_links %}{% endblock %} +{% block sidebar_shortcuts_links %} + {{ parent() }} +{% endblock %} {% block panel %}
From 8ce2ad95670ad50b92eb6456836d15d0cc0eeff8 Mon Sep 17 00:00:00 2001 From: vltrof Date: Sun, 3 Nov 2024 13:44:52 +0300 Subject: [PATCH 32/41] profiler form data collector extart value property if it is setted --- Resources/views/Collector/form.html.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Resources/views/Collector/form.html.twig b/Resources/views/Collector/form.html.twig index d99ad4f7..5da9b595 100644 --- a/Resources/views/Collector/form.html.twig +++ b/Resources/views/Collector/form.html.twig @@ -650,8 +650,10 @@ {{ profiler_dump(value) }} {# values can be stubs #} - {% set option_value = value.value|default(value) %} - {% set resolved_option_value = data.resolved_options[option].value|default(data.resolved_options[option]) %} + {% set option_value = (value.value is defined) ? value.value : value %} + {% set resolved_option_value = (data.resolved_options[option].value is defined) + ? data.resolved_options[option].value + : data.resolved_options[option] %} {% if resolved_option_value == option_value %} same as passed value {% else %} From 13d97a9acb23663550495fa2480e8cc95033ad61 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 5 Nov 2024 08:49:26 +0100 Subject: [PATCH 33/41] re-add missing profiler shortcuts on profiler homepage --- Resources/views/Profiler/results.html.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/views/Profiler/results.html.twig b/Resources/views/Profiler/results.html.twig index 551178a2..076554bb 100644 --- a/Resources/views/Profiler/results.html.twig +++ b/Resources/views/Profiler/results.html.twig @@ -36,6 +36,7 @@ {% block sidebar_search_css_class %}{% endblock %} {% block sidebar_shortcuts_links %} + {{ parent() }} {{ render(controller('web_profiler.controller.profiler::searchBarAction', query={type: profile_type }|merge(request.query.all))) }} {% endblock %} From 4afb0399456b966be92410d2bbd6146cc3ce2174 Mon Sep 17 00:00:00 2001 From: Matthew Burns Date: Tue, 19 Nov 2024 13:05:56 +1000 Subject: [PATCH 34/41] Fix twig deprecations in web profiler twig files --- Resources/views/Collector/notifier.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/Collector/notifier.html.twig b/Resources/views/Collector/notifier.html.twig index f0ee1ba3..35f271e3 100644 --- a/Resources/views/Collector/notifier.html.twig +++ b/Resources/views/Collector/notifier.html.twig @@ -138,7 +138,7 @@ {{- 'Content: ' ~ notification.getContent() }}
{{- 'Importance: ' ~ notification.getImportance() }}
{{- 'Emoji: ' ~ (notification.getEmoji() is empty ? '(empty)' : notification.getEmoji()) }}
- {{- 'Exception: ' ~ notification.getException() ?? '(empty)' }}
+ {{- 'Exception: ' ~ (notification.getException() ?? '(empty)') }}
{{- 'ExceptionAsString: ' ~ (notification.getExceptionAsString() is empty ? '(empty)' : notification.getExceptionAsString()) }}
From 2d58fd04ac0d3c6279cadd0105959083ef1d7f5b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 Nov 2024 11:11:25 +0100 Subject: [PATCH 35/41] [WebProfilerBundle] Fix Twig deprecations --- Resources/views/Collector/form.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/views/Collector/form.html.twig b/Resources/views/Collector/form.html.twig index a10c2231..37f00aca 100644 --- a/Resources/views/Collector/form.html.twig +++ b/Resources/views/Collector/form.html.twig @@ -458,7 +458,7 @@ -
+

Submitted Data

@@ -466,7 +466,7 @@
-
+

Passed Options

@@ -474,7 +474,7 @@
-
+

Resolved Options

@@ -482,7 +482,7 @@
-
+

View Vars

From 979f8ee1a4f2464c20f3fef0d2111827fef2e97e Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Mon, 9 Dec 2024 00:00:41 +0100 Subject: [PATCH 36/41] fix: preserve and nowrap in profiler code highlighting --- Resources/views/Profiler/open.css.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/views/Profiler/open.css.twig b/Resources/views/Profiler/open.css.twig index af9f0a4c..55589c29 100644 --- a/Resources/views/Profiler/open.css.twig +++ b/Resources/views/Profiler/open.css.twig @@ -40,6 +40,7 @@ #source .source-content ol li { margin: 0 0 2px 0; padding-left: 5px; + white-space: preserve nowrap; } #source .source-content ol li::marker { color: var(--color-muted); From d1801c3d2c841fa76045f9a852bd85369ed968b4 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Mon, 16 Dec 2024 18:43:45 +0100 Subject: [PATCH 37/41] =?UTF-8?q?fix:=20loading=20of=20WebProfilerBundle?= =?UTF-8?q?=E2=80=99s=20toolbar=20stylesheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/config/routing/wdt.xml | 2 +- Tests/Controller/ProfilerControllerTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/config/routing/wdt.xml b/Resources/config/routing/wdt.xml index 26bbd964..9f45f1b7 100644 --- a/Resources/config/routing/wdt.xml +++ b/Resources/config/routing/wdt.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> - + web_profiler.controller.profiler::toolbarStylesheetAction diff --git a/Tests/Controller/ProfilerControllerTest.php b/Tests/Controller/ProfilerControllerTest.php index 3933d30e..0e0a1e0a 100644 --- a/Tests/Controller/ProfilerControllerTest.php +++ b/Tests/Controller/ProfilerControllerTest.php @@ -152,15 +152,15 @@ public function testToolbarStylesheetActionWithProfilerDisabled() public function testToolbarStylesheetAction() { - $urlGenerator = $this->createMock(UrlGeneratorInterface::class); - $twig = $this->createMock(Environment::class); - $profiler = $this->createMock(Profiler::class); + $kernel = new WebProfilerBundleKernel(); + $client = new KernelBrowser($kernel); - $controller = new ProfilerController($urlGenerator, $profiler, $twig, []); + $client->request('GET', '/_wdt/styles'); + + $response = $client->getResponse(); - $response = $controller->toolbarStylesheetAction(); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame('text/css', $response->headers->get('Content-Type')); + $this->assertSame('text/css; charset=UTF-8', $response->headers->get('Content-Type')); $this->assertSame('max-age=600, private', $response->headers->get('Cache-Control')); } From 979b623f12d1eb4f6f8f24fd321dfe1dee2444a2 Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Mon, 23 Dec 2024 18:25:21 +0100 Subject: [PATCH 38/41] [WebProfilerBundle] Fix event delegation on links inside toggles --- Resources/views/Profiler/base_js.html.twig | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Resources/views/Profiler/base_js.html.twig b/Resources/views/Profiler/base_js.html.twig index f8178106..839ea59d 100644 --- a/Resources/views/Profiler/base_js.html.twig +++ b/Resources/views/Profiler/base_js.html.twig @@ -122,6 +122,12 @@ } toggle.addEventListener('click', (e) => { + const toggle = e.currentTarget; + + if (e.target.closest('a, .sf-toggle') !== toggle) { + return; + } + e.preventDefault(); if ('' !== window.getSelection().toString()) { @@ -129,9 +135,6 @@ return; } - /* needed because when the toggle contains HTML contents, user can click */ - /* on any of those elements instead of their parent '.sf-toggle' element */ - const toggle = e.target.closest('.sf-toggle'); const element = document.querySelector(toggle.getAttribute('data-toggle-selector')); toggle.classList.toggle('sf-toggle-on'); @@ -154,14 +157,6 @@ toggle.innerHTML = currentContent !== altContent ? altContent : originalContent; }); - /* Prevents from disallowing clicks on links inside toggles */ - const toggleLinks = toggle.querySelectorAll('a'); - toggleLinks.forEach((toggleLink) => { - toggleLink.addEventListener('click', (e) => { - e.stopPropagation(); - }); - }); - toggle.setAttribute('data-processed', 'true'); }); } From 7b1725cdb82c18fe4963c2a6e9b8ed39777d54e9 Mon Sep 17 00:00:00 2001 From: Hugo Posnic Date: Fri, 29 Nov 2024 11:17:22 +0100 Subject: [PATCH 39/41] [WebProfilerBundle] Fix interception for non conventional redirects --- EventListener/WebDebugToolbarListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EventListener/WebDebugToolbarListener.php b/EventListener/WebDebugToolbarListener.php index c2b350ff..87cb3d55 100644 --- a/EventListener/WebDebugToolbarListener.php +++ b/EventListener/WebDebugToolbarListener.php @@ -107,7 +107,7 @@ public function onKernelResponse(ResponseEvent $event): void return; } - if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects && 'html' === $request->getRequestFormat()) { + if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects && 'html' === $request->getRequestFormat() && $response->headers->has('Location')) { if ($request->hasSession() && ($session = $request->getSession())->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag) { // keep current flashes for one more request if using AutoExpireFlashBag $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); From 069881b41bfc73b65456e143fc176715b0549423 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 11 Feb 2025 17:41:13 +0100 Subject: [PATCH 40/41] [WebProfilerBundle] Fix tests --- Tests/EventListener/WebDebugToolbarListenerTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/EventListener/WebDebugToolbarListenerTest.php b/Tests/EventListener/WebDebugToolbarListenerTest.php index 33bf1a32..cf3c1892 100644 --- a/Tests/EventListener/WebDebugToolbarListenerTest.php +++ b/Tests/EventListener/WebDebugToolbarListenerTest.php @@ -63,6 +63,7 @@ public static function getInjectToolbarTests() public function testHtmlRedirectionIsIntercepted($statusCode) { $response = new Response('Some content', $statusCode); + $response->headers->set('Location', 'https://example.com/'); $response->headers->set('X-Debug-Token', 'xxxxxxxx'); $event = new ResponseEvent($this->createMock(Kernel::class), new Request(), HttpKernelInterface::MAIN_REQUEST, $response); @@ -76,6 +77,7 @@ public function testHtmlRedirectionIsIntercepted($statusCode) public function testNonHtmlRedirectionIsNotIntercepted() { $response = new Response('Some content', '301'); + $response->headers->set('Location', 'https://example.com/'); $response->headers->set('X-Debug-Token', 'xxxxxxxx'); $event = new ResponseEvent($this->createMock(Kernel::class), new Request([], [], ['_format' => 'json']), HttpKernelInterface::MAIN_REQUEST, $response); @@ -139,6 +141,7 @@ public function testToolbarIsNotInjectedOnContentDispositionAttachment() public function testToolbarIsNotInjectedOnRedirection($statusCode) { $response = new Response('', $statusCode); + $response->headers->set('Location', 'https://example.com/'); $response->headers->set('X-Debug-Token', 'xxxxxxxx'); $event = new ResponseEvent($this->createMock(Kernel::class), new Request(), HttpKernelInterface::MAIN_REQUEST, $response); From 7d1026a8e950d416cb5148ae88ac23db5d264839 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 14 Feb 2025 13:21:59 +0100 Subject: [PATCH 41/41] fix rendering notifier message options --- Resources/views/Collector/notifier.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/Collector/notifier.html.twig b/Resources/views/Collector/notifier.html.twig index 9de8d216..ed363f1d 100644 --- a/Resources/views/Collector/notifier.html.twig +++ b/Resources/views/Collector/notifier.html.twig @@ -151,7 +151,7 @@ {%- if message.getOptions() is null %} {{- '(empty)' }} {%- else %} - {{- message.getOptions()|json_encode(constant('JSON_PRETTY_PRINT')) }} + {{- message.getOptions().toArray()|json_encode(constant('JSON_PRETTY_PRINT')) }} {%- endif %}