Default template uses incorrect naming

Created on 22 March 2022, over 3 years ago
Updated 31 May 2022, about 3 years ago

Problem/Motivation

The template provided by go_back does not use the correct naming based on its valid suggestions. See the suggestions attached. Due to this if someone copies the template from the module to their theme to override (like they would any other template), they receive many errors in theme suggestions and template preprocess hooks due to the missing 'elements' array key.

Error message
Notice: Trying to access array offset on value of type null in block_theme_suggestions_block() (line 200 of core/modules/block/block.module).
block_theme_suggestions_block(Array)
call_user_func_array('block_theme_suggestions_block', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('theme_suggestions_block', Array) (Line: 230)
Drupal\Core\Theme\ThemeManager->render('block__goback', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 76)
__TwigTemplate_767c3b1770fc04d0f465248722b7a1b8e1a7ee2c2149485d424d73b6fb6bb2b0->block_content(Array, Array) (Line: 182)
Twig\Template->displayBlock('content', Array, Array) (Line: 64)
__TwigTemplate_767c3b1770fc04d0f465248722b7a1b8e1a7ee2c2149485d424d73b6fb6bb2b0->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('core/themes/stable/templates/block/block.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 157)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 158)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 172)
Drupal\Core\Render\Renderer->renderPlaceholder('callback=Drupal%5Cblock%5CBlockViewBuilder%3A%3AlazyBuilder&args%5B0%5D=gobackblock&args%5B1%5D=full&args%5B2%5D&token=Jo_IWmFeGrolThZI8MLuZsPNK8mP4Ed5e-X1NgSu6CY', Array) (Line: 693)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder('callback=Drupal%5Cblock%5CBlockViewBuilder%3A%3AlazyBuilder&args%5B0%5D=gobackblock&args%5B1%5D=full&args%5B2%5D&token=Jo_IWmFeGrolThZI8MLuZsPNK8mP4Ed5e-X1NgSu6CY', Array) (Line: 547)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object) (Line: 305)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 381)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)

Steps to reproduce

1. Install go_back
1. Configure to show on any page
1. Copy template from go_back to theme
1. Clear cache
1. Refresh page to see errors

Proposed resolution

Update the default template provided to match one of the suggestions.

Remaining tasks

- [x] Rename template

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Updated template from 'block--goback' to 'block--gobackblock'

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mrogers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024