Problem/Motivation

Currently, there are two theme implementations defined in the graphql_theme() hook. They are not connected to any theme templates, which has caused fatal errors on some pages—e.g., /graphql-explorer and /graphql_voyager. I suspect there may be a correlation between core/contrib page theme suggestions and these two themes. These URLs likely attempt to render the page using the themes defined by the graphql_theme() hook, and since no templates are connected, a fatal error occurs.

The website encountered an unexpected error. Try again later.

Twig\Error\LoaderError: Template "modules/contrib/graphql/templates/page--graphql-explorer.html.twig" is not defined. in Twig\Loader\ChainLoader->getCacheKey() (line 55 of core/themes/olivero/templates/layout/html.html.twig).
Twig\Environment->getTemplateClass('modules/contrib/graphql/templates/page--graphql-explorer.html.twig', NULL) (Line: 204)
Drupal\Core\Template\TwigEnvironment->getTemplateClass('modules/contrib/graphql/templates/page--graphql-explorer.html.twig') (Line: 371)
Twig\Environment->load('modules/contrib/graphql/templates/page--graphql-explorer.html.twig') (Line: 33)
twig_render_template('modules/contrib/graphql/templates/page--graphql-explorer.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 446)

Proposed resolution

Since there doesn’t appear to be any usage of these theme implementations, I believe they should be removed.

Issue fork graphql-3538511

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

id.aleks created an issue. See original summary.

id.aleks’s picture

Assigned: id.aleks » Unassigned
Status: Active » Needs review
StatusFileSize
new845 bytes

I’ve created a merge request that removes the graphql_theme() hook. I’m also including a patch for the 8.x-4.x-dev version. Please review.

id.aleks’s picture

StatusFileSize
new845 bytes

Fixed the patch file extension.

klausi made their first commit to this issue’s fork.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Fixed gitlab pipeline fails in #3538594: Fix Gitlab pipeline in 4.x, merged that into the MR.

Put it on the merge train, should be committed soon.

  • klausi committed 88a70739 on 8.x-4.x authored by id.aleks
    fix(theme): Removed abandoned theme implementations defined by...

  • klausi committed 79642a0e on 5.x authored by id.aleks
    fix(theme): Removed abandoned theme implementations defined by...
klausi’s picture

Status: Reviewed & tested by the community » Fixed

Merged.

id.aleks’s picture

@klausi Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.