Support » Plugin: Publish To Apple News » Image URL resolving in JSON but not in time for API call

  • Resolved jayhoogle

    (@jayhoogle)


    When I try to publish any article, I get the following error:

    There has been an error with the API: INVALID_DOCUMENT - The value for the property "URL" at line 1 and column 387 is not valid: /wp-content/uploads/2020/08/shutterstock_1117818974.jpg (keyPath components->0->components->0->URL)

    When I download the JSON of the file, all image URLs are resolved correctly to the domain of our site, but it seems as though the API only has the URL without the domain so am wondering if that’s what’s causing our articles not to publish?

    The article text: https://pastebin.com/cxcMQznD
    The article JSON: https://pastebin.com/LbhUTTvL
    The API response and error: https://pastebin.com/jtKiRPK5

    Let me know if you need any more information.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kevin Fodness

    (@kevinfodness)

    Downloading the content of the articles is a slightly different procedure from publishing them to Apple News, in terms of what functionality is initialized at the time. Some plugins only initialize in certain contexts and not others (such as whether is_admin() returns true, which it would on the articles listing page where you download the JSON, but not if you are clicking the Publish button in the Gutenberg sidebar, for instance, as that is a REST request).

    The default behavior for pulling the image URL for the header photo, which is likely set as the featured image on your article, would be to generate a fully qualified URL, but it seems like something is interfering with that process, and my guess would be a third party plugin or a customization in your theme. You should be able to test this by (in a test environment) turning off all other third party plugins and switching your WordPress theme to one of the defaults (e.g., Twenty Twenty). If the problem goes away, then it’s due to one of those other factors, and you should be able to switch things back on until you discover which one is causing the issue.

    Plugin Author Kevin Fodness

    (@kevinfodness)

    Moving this discussion to the GitHub thread you started: https://github.com/alleyinteractive/apple-news/issues/776

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.