Skip to content
Snippets Groups Projects
Commit 47523310 authored by Eli Stone's avatar Eli Stone
Browse files

Issue #3404044 by InaW, larskleiner: Call to undefined method error when twig debug mode is enabled

parent 96593c60
No related branches found
No related tags found
No related merge requests found
Pipeline #227872 failed
......@@ -8,9 +8,7 @@
let variables = element.dataset.graphqlVariables;
const form = document.createElement('form');
form.action = Drupal.url(
`admin/config/graphql/servers/manage/${server}/explorer`
);
form.action = Drupal.url('graphql/explorer');
form.method = 'post';
form.target = '_blank';
......
......@@ -108,18 +108,17 @@ trait GraphQLTemplateTrait {
if ($this->env->isDebug() && $debug_placement == 'wrapped') {
printf(
'<div class="%s" data-graphql-query="%s" data-graphql-variables="%s" data-graphql-server="%s">',
'<div class="%s" data-graphql-query="%s" data-graphql-variables="%s">',
'graphql-twig-debug-wrapper',
htmlspecialchars($query),
htmlspecialchars(json_encode($arguments)),
$this->env->getGraphQlServer()->id()
);
}
if ($this->env->isDebug() && $queryResult->errors) {
print('<ul class="graphql-twig-errors">');
foreach ($queryResult->errors as $error) {
printf('<li>%s</li>', $error->message);
printf('<li>%s</li>', $error->getMessage());
}
print('</ul>');
}
......@@ -133,11 +132,10 @@ trait GraphQLTemplateTrait {
if ($this->env->isDebug() && $debug_placement == 'inside') {
$context['graphql_debug'] = [
'#markup' => sprintf(
'<div class="graphql-twig-debug-child"><div class="%s" data-graphql-query="%s" data-graphql-variables="%s" data-graphql-server="%s"></div></div>',
'<div class="graphql-twig-debug-child"><div class="%s" data-graphql-query="%s" data-graphql-variables="%s"></div></div>',
'graphql-twig-debug-wrapper',
htmlspecialchars($query),
htmlspecialchars(json_encode($arguments)),
$this->env->getGraphQlServer()->id()
htmlspecialchars(json_encode($arguments))
),
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment