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

Revision Compare: show diff between custom template and theme template #45290

Closed
georgeh opened this issue Oct 25, 2022 · 3 comments
Closed

Revision Compare: show diff between custom template and theme template #45290

georgeh opened this issue Oct 25, 2022 · 3 comments
Labels
[Feature] History History, undo, redo, revisions, autosave. [Type] Enhancement A suggestion for improvement.

Comments

@georgeh
Copy link
Contributor

georgeh commented Oct 25, 2022

What problem does this address?

When viewing the history of a template or template part in the revision compare screen, the oldest revision is empty and listed as "Removed":

image

What is your proposed solution?

When comparing templates or template parts, the oldest version should be the theme-supplied version on the filesystem. Also, choosing to restore that version should do the same as the "Clear customizations" action when browsing templates and template parts.

@priethor priethor added [Type] Enhancement A suggestion for improvement. [Feature] History History, undo, redo, revisions, autosave. labels Oct 26, 2022
@carlomanf
Copy link

The template and template part post types are registered with $args['show_ui'] = false so I'm honestly surprised that this screen is available at all. Not saying that there shouldn't be a way to edit revisions for these post types, but if I registered a post type with $args['show_ui'] = false then I would expect access to all editing screens including this one to be barred.

@carlomanf
Copy link

Further to the above, I would argue the output on this particular screen is correct. The reason is it's a generic interface that is intended to work with conventional post types. Templates and template parts are not conventional post types, and it should be expected that their unconventional implementation might cause unexpected effects with the generic editing screens, such as the one reported here. Hence they are registered with $args['show_ui'] = false and why this screen should not be available for these post types or for any that are registered with $args['show_ui'] = false.

Diluting a generic interface to accommodate a special case with a particular post type does not seem like the right approach and will just cause issue after issue, similar to the historical use of auto-drafts to represent file-based templates.

@annezazu
Copy link
Contributor

Noting that this matches the discussion here: #50675 Closing out as a result of what's found there. Happy to reopen if I'm missing something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] History History, undo, redo, revisions, autosave. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants