Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Return previewLink from post link only if available #12800

Merged
merged 4 commits into from
Dec 21, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Dec 11, 2018

Fixes #12677

This pull request seeks to resolve an error which occurs when autosaving a post whose post type is registered using 'publicly_queryable' => false.

An in-depth explanation of the issue can be found at #12677 (comment) .

Testing instructions:

Verify using the following example post type definition that autosave occurs without error:

<?php

/**
 * Plugin Name: Demo CPT
 */
add_action( 'init', function() {
	register_post_type( 'book', [
		'label' => 'Book',
		'show_in_rest' => true,
		'public' => true,
		'publicly_queryable' => false,
		'supports' => [ 'title', 'editor', 'revisions' ],
	] );
} );

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Saving Related to saving functionality labels Dec 11, 2018
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 It fixed the problem in my tests.

@youknowriad youknowriad added this to the 4.8 milestone Dec 20, 2018
@youknowriad youknowriad merged commit 13683ff into master Dec 21, 2018
@youknowriad youknowriad deleted the fix/12677-preview-link-empty branch December 21, 2018 08:27
youknowriad pushed a commit that referenced this pull request Jan 3, 2019
* Editor: Return previewLink from post link only if available

* Editor: Add CHANGELOG entry for publicly_queryable autosave fix

* Editor: Resolve previewLink lint errors

* Editor: Document autosave error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Saving Related to saving functionality [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Post type: If param 'publicly_queryable' = 'false' the editor shows "Updating failed" notice.
3 participants