Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No object in get_ticket_args() #26

Open
justlevine opened this issue Dec 27, 2020 · 0 comments
Open

No object in get_ticket_args() #26

justlevine opened this issue Dec 27, 2020 · 0 comments

Comments

@justlevine
Copy link
Contributor

Getting an issue in Ticket_Connection_Resolver::get_ticket_args().

When the query is run in Graphiql, is_object( $source) is evaluating to false for some reason, which causes the $connection_type to be undefined, and throws the following PHP notice: Undefined variable: connection_type in /var/www/thegsc/wp-content/plugins/ql-events/includes/data/connection/class-ticket-connection-resolver.php on line 53.

Can be solved one of three ways:

  1. Set $connection_type = false at the top of the function.
  2. Return early if source isnt an object:
if ( ! is_object( $source ) {
    return $query_args;
}

switch( $info->fieldName) { 
...
  1. change if ($connection_type) to if ( isset ( $connection_type ) ).

Not sure it matters, but because I don't know why `is_object( $source ) is false, I dont want to be responsible for hiding a deeper issue.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant