Since “Support revisions in different states” went into the core it is now theoretically possible to have forward revisions of nodes. For example publish revision 1 then create revision 2 but keep it unpublished. This is very useful when someone needs to create new version of a node that needs to be approved before publishing.
Sounds great so here’s what I did:
- I’ve created a node with title “Published revision”. The node ID is
1and it’s revision is1. - I’ve created a new revision of node
1and changed it’s title to “Unpublished revision”. This node has revision2and it has immediately been set as default revision. - At this moment
/node/1shows the node with title “Unpublished revision”. - I’ve used PHP to load node
1with revision1and I’ve set it to default revision ($node->isDefaultRevision(true)). - At this moment
/node/1shows the node with title “Published revision”.
So far so good. However the problem is that I’d like to edit revision 2 but I can’t:
/node/1/editshows edit form of revision1./node/1/revisions/2/editis of course 404.- And on top of that when I go to
/node/1/revisionsthe revision2is listed as “Current” which of course is not true because default revision is1. (Let’s say I can live with that for now)
Questions:
- How to edit arbitrary node revision?
- How to control which node revision is saved as default revision?
Sponsored by SupremePR