Make WordPress Core

Opened 21 months ago

Closed 12 months ago

Last modified 12 months ago

#57704 closed enhancement (fixed)

Add revisions to the links of the template and template part REST endpoint

Reported by: andraganescu's profile 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)

#1 @flixos90
21 months ago

@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

#2 @andraganescu
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 @andraganescu
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 @oandregal
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:

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:

#5 @andraganescu
17 months ago

@oandregal I am not sure, I think @spacedmonkey and/or @TimothyBlynJacobs should weigh in here.

#6 @spacedmonkey
17 months ago

I believe that this ticket is blocked by #56922. #56922 has been worked on in a while and need more to get into core.

Willing to review anymore that come in for #56922.

This ticket was mentioned in Slack in #core by chaion07. View the logs.


17 months ago

#8 @chaion07
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

#9 @hellofromTonya
15 months ago

  • Milestone changed from Future Release to 6.4

I moved #56922 into the 6.4 milestone for visibility and to hopefully wrangle some folks to possibility get it moving forward in time to ship in 6.4.

Moving this ticket into the milestone too. Once #56922 gets unblocked and committed, then this ticket can move forward too.

#10 @kafleg
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 @oglekler
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 @spacedmonkey
13 months ago

@andraganescu Now that #56922 is committed, what is needed for this ticket? Seems to be working in my testing.

#13 @andraganescu
12 months ago

  • Resolution set to fixed
  • Status changed from new to closed

I believe this ticket can be close. Thank you for the work enabling this!

#14 @ironprogrammer
12 months ago

  • Milestone changed from 6.5 to 6.4

Moving back into the 6.4 milestone for clarity of when this was addressed (i.e. via #56922).

Note: See TracTickets for help on using tickets.