ExpressionEngine deletes data from custom ChannelEntry fields before the before_channel_entry_delete hook runs. All the story data we use to determine whether to push a delete to npr's story api is contained in custom fields, so cannot be used.
Consider creating a pushed_story table on installation and adding a row with entry_id, npr_story_id on push. On delete, retrieve npr_story_id from pushed_story by entry_id. If a story id is found, push a delete to npr.
In GitLab by @areynold on Oct 4, 2019, 15:02
ExpressionEngine deletes data from custom ChannelEntry fields before the before_channel_entry_delete hook runs. All the story data we use to determine whether to push a delete to npr's story api is contained in custom fields, so cannot be used.
Consider creating a pushed_story table on installation and adding a row with entry_id, npr_story_id on push. On delete, retrieve npr_story_id from pushed_story by entry_id. If a story id is found, push a delete to npr.