• Resolved John Lyman

    (@jlyman)


    The plugin was working great now I’m getting Invalid Document errors that seem fairly daunting to resolve. Any help in figuring it out would be appreciated.

    There has been an error with the Apple News API:
    INVALID_DOCUMENT – ‘text’ property is null or not textual. (keyPath components->1->components->2->components->0)
    INVALID_DOCUMENT – ‘text’ property is null or not textual. (keyPath components->1->components->2->components->0)
    INVALID_DOCUMENT – ‘text’ property is null or not textual. (keyPath components->1->components->2->components->0)
    INVALID_DOCUMENT – “text” was should be not (null or an empty string) (keyPath components->1->components->2->components->0->text)

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

    (@kevinfodness)

    You’ll need to download the article JSON for the article that is failing (Apple News > Articles from the WordPress sidebar, then click Download) and then chase down the specific path the errors are giving you. There is a top-level components key, then look at the second item within that (arrays are zero-indexed, so 1 is actually the second item), then look in the components key within that item, then the third item, then components, then the first item (components->1->components->2->components->0 in the example above). What Apple’s API is objecting to is an element that has no text, like an empty paragraph. The plugin has some defensive code in it to try to prevent empty elements from being sent to Apple, but due to the number of third party plugins and custom themes out there, it’s not possible to predict every circumstance under which a blank node would be rendered. Once you figure out what the culprit is based on what’s in the JSON, you should be able to figure out how to fix it (maybe it’s a blank paragraph in your content that you can remove, or maybe there is a custom embed or some custom code that is introducing the problem).

    If you are able to reproduce this issue on a fresh install of the Apple News plugin using one of the default themes that ships with WordPress and no other third party plugins installed, then please file a GitHub issue (https://github.com/alleyinteractive/apple-news/issues) and we will put a fix in the plugin itself.

Viewing 1 replies (of 1 total)
  • The topic ‘Apple News was working great, then….’ is closed to new replies.