ql-events
ql-events copied to clipboard
No object in get_ticket_args()
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:
- Set
$connection_type = false
at the top of the function. - Return early if source isnt an object:
if ( ! is_object( $source ) {
return $query_args;
}
switch( $info->fieldName) {
...
- change
if ($connection_type)
toif ( 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?