-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OEL-1543: Rename block templates to target plugin ids instead of block ids. #137
Conversation
$form = $crawler->filter('#oe-whitelabel-search-form'); | ||
// The template removes block wrappers for this block. | ||
$this->assertSame('body', $form->parents()->getNode(0)->tagName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$form = $crawler->filter('#oe-whitelabel-search-form'); | |
// The template removes block wrappers for this block. | |
$this->assertSame('body', $form->parents()->getNode(0)->tagName); | |
$form = $crawler->filter('body > #oe-whitelabel-search-form'); | |
// The template removes block wrappers for this block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like!
But now we have to move the comment elsewhere.
// Select the search form in the block. | ||
// The block template removes the block wrapper, so the form is the root | ||
// element. | ||
$form = $crawler->filter('body > form#oe-whitelabel-search-form'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it adds clarity to also have form
in the selector.
@@ -122,10 +122,10 @@ public function testBlockRendering(): void { | |||
$render = $this->container->get('renderer')->renderRoot($build); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to rename the variables here, but I then decided to rather not touch this part.
E.g. $render
-> $markup
, $entity
-> $block_entity
.
We can do this another day.
* | ||
* @see ./core/themes/stable/templates/block/block.html.twig | ||
* @see \Drupal\facets_form\Plugin\Block\FacetsFormBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments had changed in 1.x since before last rebase.
Please decide if my version or the 1.x version is preferable.
* | ||
* @see ./core/themes/stable/templates/block/block.html.twig | ||
* @see \Drupal\facets_summary\Plugin\Block\FacetsSummaryBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments had changed in 1.x since before last rebase.
Please decide if my version or the 1.x version is preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, think their better, since the location of the indicated block template should have been the block module not the stable theme
…wig. The block had been renamed long ago in e6eadb0 / OEL-1192.
Interestingly the template was working with underscore. But the correct way is to use dashes instead. See also https://www.drupal.org/project/drupal/issues/2129665.
…ock id. Update tests, because now the template also affects the block in SearchBlockTest.
This is needed so they still work in sub-themes.