Score:0

Toolbar and gulp/browsersync: body tag overwritten with comment

cn flag

In Drupal 10, with a gulp/browserSync sync to localhost:3000, I am getting the comments in web/core/modules/toolbar/toolbar.module showing up at the top of my page.

// These are classes that toolbar typically adds to <body>, but this code
// executes before the first paint, when <body> is not yet present. The
// classes are added to <html> so styling immediately reflects the current
// toolbar state. The classes are removed after the toolbar completes
// initialization.

It looks like the first <body> tag in the comments is replacing the actual HTML body tag. If I edit this comment to when body is not yet present, the problem does not happen. (Yes, I know I should not edit core files; it was just a test to find the cause.)

The problem also does not happen when viewing the site without going through browsersync.

This may be more a browsersync problem, but it started happening with Drupal 10.

ice70 avatar
cn flag
should also note, I had to remove the brackets for all <body> and <html> in the comments
id flag
This seems more of a bug report for maintainers than a question about Drupal that we could answer.
Kevin avatar
in flag
https://www.drupal.org/project/drupal/issues/3355381#comment-15106592
TaraZingo avatar
vu flag
There is an issue with the patch https://www.drupal.org/project/drupal/issues/3379245
ice70 avatar
cn flag
Thank you for the issue notice. Rather than use the patch, I updated the .theme as per comment 7: https://www.drupal.org/project/drupal/issues/3379245#comment-15181653 . As of yet, I have not seen the patch problems mentioned in the comments with logged in users who have toolbar permissions, logging out and getting the empty gap at the top.
ice70 avatar
cn flag
Looks like this should now be fixed in 10.1.3: https://www.drupal.org/node/3383056
id flag
I’m voting to close this question because there is a comment reporting this is a bug and that it was fixed in drupal.org/node/3383056.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.