Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When executing a graphql-query which queries for a redirect for a given path, which doesn't have a redirect, an "Undefined index" error is shown in the log.
Steps to reproduce
- Open GraphQL Explorer
- Execute a query for a redirect on a path which does not have a redirect, like this:
query RedirectIndexUndefined { redirect(path:"/"){ url } }
- Notice "Undefined index"...
Proposed resolution
On the ResolverHelperTrait, add a check if the array key exists in the addSimpleCallbackFields function.
Comments
Comment #2
daniel.bosenThanks for finding this issue!
A pull request was created to fix the issue:
https://github.com/thunder/thunder-distribution/pull/461/
To test this locally please execute:
composer require thunder/thunder-distribution:dev-fix/redirect-notice
Comment #3
daniel.bosenComment #5
daniel.bosenreviewed on GitHub
Comment #6
daniel.bosenMerged, Thank you!