#57704 closed enhancement (fixed)
Add revisions to the links of the template and template part REST endpoint
Reported by: | andraganescu | Owned by: | |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | minor | Version: | |
Component: | REST API | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Because templates and template parts are just custom post types we already have revisions saved for them. Being able to access and use the revisions screen for templates and template parts in block themes therefore seems a low hanging fruit enhancement.
In https://github.com/WordPress/gutenberg/pull/45215 a first step to use this available feature has been taken - to simply display a button that sends the user to the revisions management screen.
To be able to achieve this, however, the API requires a decoration of the template controller with links that hold the revision count and previous revision, because of this bug in https://core.trac.wordpress.org/ticket/56922
To port this change to core we need to bring this decoration over, either via a solution similar to the one merged in Gutenberg or via the solution explored in https://core.trac.wordpress.org/ticket/56922
Change History (14)
#2
@
21 months ago
- Priority changed from high to normal
- Severity changed from normal to minor
Hi @flixos90,
A problem I have is in the Gutenberg PR a bug was uncovered in the REST API - so it depends on how we look at it - is it an enhancement of the editor brought by offering that button to users, or is it also a bug fix in the template rest API endpoints?
It is not a must have, it is definitely a nice to have in 6.2, nothing will break if this does not land. On the other hand it is such a low hanging fruit enhancement, received with such positive feedback, that we may want to try and see if it is possible to land it in 6.2.
It is clear that if we can add the proper bug fix to the REST API in 6.2, either by porting the PHP solution in the Gutenberg PR or by implementing a more thorough fix as seen in https://core.trac.wordpress.org/ticket/56922, the porting of the code to show the button is pretty harmless even as we're past the cutoff for enhancements.
I will say that I fully understand a decision to skip for multiple reasons:
- I may not have a full understanding of scope of updates in the REST API
- I am about to open a ticket about that Gutenberg PR itself, which only adds even more work (the links in the revisions editor don't go back to the editor)
- It's only a nice to have :)
Yet, it is possible and nice to have :)
#3
@
21 months ago
- Milestone changed from 6.2 to 6.3
With #57709 moved to 6.3 due to having to deal with a new shape of edit links in WP admin, this should also move to the next release.
#4
@
17 months ago
@draganescu I was looking at doing the backport for https://github.com/WordPress/gutenberg/pull/48078 for 6.3, which essentially merged Gutenberg_REST_Template_Revision_Count
into Gutenberg_REST_Templates_Controller_6_3
. Gutenberg_REST_Template_Revision_Count
was introduced by https://github.com/WordPress/gutenberg/pull/45215 which this ticket aims to backport.
Looking at this, my understanding is that it was blocked by two things:
- https://core.trac.wordpress.org/ticket/57709 it has been fixed since.
- https://core.trac.wordpress.org/ticket/56922 still open.
I'm out of my expertise here, so may have a uncalibrated intuition, though it sounds like this is not ready for 6.3, is that correct?
It sounds to me that the next steps are:
- List https://github.com/WordPress/gutenberg/pull/48078 in this ticket description (would you be able to do that, Andrei?).
- Find a way to mark those changes in Gutenberg as "blocked by upstream". I'll bring this up in the original PR at https://github.com/WordPress/gutenberg/pull/45215
#5
@
17 months ago
@oandregal I am not sure, I think @spacedmonkey and/or @TimothyBlynJacobs should weigh in here.
This ticket was mentioned in Slack in #core by chaion07. View the logs.
17 months ago
#8
@
17 months ago
- Milestone changed from 6.3 to Future Release
Thanks @andraganescu for reporting this. We reviewed this ticket during a recent bug-scrub session have decided to move it to Future Release due to #56922 blocker. Cheers!
Props to @oglekler & @audrasjb
#10
@
15 months ago
I'm looking for this feature as I faced issue while working on my personal blog. As there is no revision feature, I had to restore backup from my hosting.
#11
@
14 months ago
- Milestone changed from 6.4 to 6.5
I forced to disappoint everyone who is waiting for this to be resolved, there is no patch and no time before Beta 1 to make and test one, so, I am moving this ticket into the 6.5 milestone.
#12
@
13 months ago
@andraganescu Now that #56922 is committed, what is needed for this ticket? Seems to be working in my testing.
@andraganescu Is this necessary for 6.2? Since the Gutenberg PR was merged just 5 days ago and we are past the beta cut off for enhancements, I am not sure it's a good idea to introduce significant REST API changes at this point; particularly as even that Gutenberg code was marked as experimental.
I would suggest to move this to the 6.3 milestone for consideration. cc @hellofromTonya