Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
As reported in #402, if a connection has no supported post types for pulling, a PHP notice is shown (if debug is turned on). Fixing this, I also realized that if a connection has no post types available, we default to still showing content from the
post
post type, which seems non-ideal. So this PR fixes that as well, so if there are no post types available for pulling, we show theNo items found
message.Also in addition, while testing this, I was able to reproduce another PHP notice on this screen. We have a helper function to output any pull error messages and this only accounted for external connections, so when using an internal connection, a PHP notice is shown. And finally, it's possible for internal and external connections to have the same ID and the way we were storing these error messages wasn't accounting for that. So I've made a change so transient key we use now is different for both internal and external connections, to avoid any potential overlap.
Alternate Designs
None
Benefits
No more PHP notices will be shown and this fixes a few additional bugs.
Possible Drawbacks
None
Verification Process
add_filter( 'dt_available_pull_post_types', '__return_empty_array' );
Checklist:
Applicable Issues
Fixes #402