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

  1. Open GraphQL Explorer
  2. Execute a query for a redirect on a path which does not have a redirect, like this:
    query RedirectIndexUndefined {
      redirect(path:"/"){
      	url
      }
    }
  3. Notice "Undefined index"...

Proposed resolution

On the ResolverHelperTrait, add a check if the array key exists in the addSimpleCallbackFields function.

Comments

eakroko created an issue. See original summary.

daniel.bosen’s picture

Thanks 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

daniel.bosen’s picture

Status: Active » Needs review

  • daniel.bosen authored 87bf302 on 6.2.x
    Issue #3250638 by eakroko: GraphQL undefined index error
    
    
daniel.bosen’s picture

Status: Needs review » Reviewed & tested by the community

reviewed on GitHub

daniel.bosen’s picture

Status: Reviewed & tested by the community » Fixed

Merged, Thank you!

Status: Fixed » Closed (fixed)

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