• Resolved kieranmcclung

    (@kieranmcclung)


    Hello, I hope all is well.

    I’m having an issue with a website of ours at the moment whereby no content is displaying on the single template (with or without an override). I have a query elsewhere on the site (in the sidebar) which does return the correct query info back, however.

    The code in question is below. The query var is used because of a template / permalink arrangement and was working until recently. Is there anything you can think of that could be causing issues on the single template?

    The ‘eventbrite_id’ is being pulled in correctly from the query_var and matches that on the Eventbrite site so I know a connection is being made. And of course the sidebar content is returning as intended.

    // Broken code
    $event = new Eventbrite_Query( apply_filters( ‘eventbrite_query_args’, array(
    ‘p’ => get_query_var( ‘eventbrite_id’ )
    ) ) );

    // Working version
    $events = new Eventbrite_Query( apply_filters( ‘eventbrite_query_args’, array(
    ‘limit’ => 2
    ) ) );

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Automattic

    (@automattic)

    Hm, nothing obvious seems out of place; does it work if you remove the eventbrite_query_args filtering?

    Thread Starter kieranmcclung

    (@kieranmcclung)

    Gah, sorry I didn’t realise you had replied! Unfortunately not, initially it didn’t have that in place so I added it to see whether it would fix the issue.

    Thread Starter kieranmcclung

    (@kieranmcclung)

    I have some more information. I’ve installed Query Monitor on the site and noticed that the HTTP request to Eventbrite is returning a 404 error with the details below. However if I enter in the OAuth token in the right hand side field it works correctly. Would there be a reason as to why the http request isn’t including the OAuth token?

    Strangely, though, these errors are appearing on the sidebar calls which is displaying events correctly.

    REQUEST

    PARSED AUTHENTICATION

    OAuth token: No valid OAuth token
    RESPONSE

    HTTP 401 UNAUTHORIZED
    Vary: Accept
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Authorization, Content-Type
    Content-Type: text/html; charset=utf-8
    Allow: GET, POST, DELETE, HEAD, OPTIONS
    {
    “status_code”: 401,
    “error_description”: “An OAuth token is required for all requests”,
    “error”: “NO_AUTH”
    }

    Plugin Author Automattic

    (@automattic)

    Hm, so, in your original example, does $event have the proper data? Meaning, is the API call fine, and the problem is in the rendering further down the template, or is it an empty result?

    Not sure about the auth error; can you narrow down which request is doing it?

    Plugin Author Automattic

    (@automattic)

    Hi Kieran, are you still having issues with this? Can you tell if $event has the proper data, mentioned above?

    Plugin Author Automattic

    (@automattic)

    Closing; just open a new thread if you’re still having issues.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Content not appearing on single template’ is closed to new replies.