-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Links to the editor don't work for template and template parts revisions in the revisions screen #48065
Comments
@draganescu Sorry, newbie question maybe, but where do I even find the revision screen for template parts? I tried to recreate this issue on my end with both the Gutenberg plugin activated and deactivated, but I can't seem to find the revision screen for templates or template parts. |
@thomasdevisser
how-to-get-to-revisions.mp4 |
Thank you @draganescu. It looks like the issue is that the entire href is missing on both these anchor tags. That's why you're seeing the URI of the screen you're already on. |
On further inspection, in core, |
In the // If there's no specified edit link and no UI, remove the edit link.
if ( ! $args['show_ui'] && ! $has_edit_link ) {
$args['_edit_link'] = '';
} The actual edit URI should be So to fix this issue we could go in two directions:
if ( $post_type_object->_edit_link ) {
$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
} elseif ( 'wp_template_part' === $post_type_object->name ) {
$link = '/wp-admin/site-editor.php?postType=wp_template_part&canvas=edit&';
// postId = twentytwentythree%2F%2Fcomments
// path = %2Ftemplate-parts%2Fsingle
} else {
$link = '';
}
This should therefore probably be moved to the wordpress-develop GitHub, but I'm not sure as I'm also new here. 🙂 |
@thomasdevisser you are right it would be easier to patch core directly for this and to try a PR in the wordpress-develop GitHub. Also thank you for investigating, yes I as well believe we need to:
|
I'm looking at global styles revisions and have come across this and the first revision bug as well. I've been looking at the suggestion above and I've nearly got it working: Just checking if there's been any progress. If not I can carry on 😄 I also wondered whether it might be a decent fallback to send the edit link in the URL params, given that Gutenberg site-editor.php links could change ? |
…lates, template_parts and global styles. See: WordPress/gutenberg#48065
This entirely breaks the experience. Noting this as high priority to fix and adding to the phase 2 board. Can someone indicate whether they will be taking this on to resolve? |
…lates, template_parts and global styles. See: WordPress/gutenberg#48065
Looks like there's an existing fix at WordPress/wordpress-develop#4229 |
The existing fix got merged upstream @ramonjd. Given 6.3 won't be released until August will GB get patched to fix the broken revisions screen before then? |
I think it should be yes, but not sure how. |
@hellofromtonya is this something you can help with? |
It should be doable using a combo of |
Backport here: |
In #45215 the template and template part editors gained a button that links to the revisions screen for the edited template and template part.
The problem is that in the revisions screen there are two links that should link back to the editor which don't work (one with the template name and another one with the text "go to editor").
In the post editor (block editor) going to the revisions screen will set these links to a shape of:
/wp-admin/post.php?post=3594&action=edit
In the template editor going to the revisions screen will set these links to a shape of:
/wp-admin/revision.php?revision=4068&gutenberg=true
, which is the URI of the revisions screen itself.This is a blocker for https://core.trac.wordpress.org/ticket/57704
There is a corresponding core ticket at https://core.trac.wordpress.org/ticket/57709
The text was updated successfully, but these errors were encountered: