Implementations of hook_node_update should check the "isDefaultRevision" property

Created on 8 April 2012, almost 13 years ago
Updated 14 January 2025, 7 days ago

For Drupal 8 to support "forward revisions" it must declare during node_save whether the given node object is meant to go in the node table or not. Agentrickard has started a patch to this end at #218755-106: Support revisions in different states β†’

The addition of the is_live property means that many modules implementing hook_node_update() will have to check that the given revision is going live.

For instance, the path module should not change the alias for node/123 if the revision of 123 being saved is not going to the node table.

This patch is a start. There are UI implications to this change. With this patch, data entered in the URL alias field is discarded if the revision isn't going live.

Finally I think this patch will fail testing as it does not include the is_live property from #218755-106: Support revisions in different states β†’ and some tests will have to be modified/added to deal with is_live anyway.

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component

node system

Created by

πŸ‡ΊπŸ‡ΈUnited States stevector Minneapolis, MN

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    I think the only bit here that's not addressed yet is search, which is in \Drupal\node\Entity\Node::postSave() now, there are also node_comment hooks that update the search index.

Production build 0.71.5 2024