Skip to content

Commit bbd91fc

Browse files
Merge branch '6.4' into 7.3
* 6.4: [GitHub] Update .github/PULL_REQUEST_TEMPLATE.md to remove SF 7.2 as it's not supported anymore [WebProfilerBundle] Fix toolbar not rendering after replacing it [HtmlSanitizer] Fix force_attributes not replacing existing attribute in initial data
2 parents c5e0245 + 4c1754d commit bbd91fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Resources/views/Profiler/toolbar_js.html.twig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,16 @@
512512
'sfwdt' + token,
513513
'{{ url("_wdt", { "token": "xxxxxx" })|escape('js') }}'.replace(/xxxxxx/, newToken),
514514
function(xhr, el) {
515+
var toolbarContent = document.getElementById('sfToolbarMainContent-' + newToken);
516+
515517
/* Do nothing in the edge case where the toolbar has already been replaced with a new one */
516-
if (!document.getElementById('sfToolbarMainContent-' + newToken)) {
518+
if (!toolbarContent) {
517519
return;
518520
}
519521
522+
/* Replace the ID, it has to match the new token */
523+
toolbarContent.parentElement.id = 'sfwdt' + newToken;
524+
520525
/* Evaluate in global scope scripts embedded inside the toolbar */
521526
var i, scripts = [].slice.call(el.querySelectorAll('script'));
522527
for (i = 0; i < scripts.length; ++i) {

0 commit comments

Comments
 (0)