API page: https://api.drupal.org/api/drupal/modules%21node%21node.module/function/...

Problem
node_revision_delete is doing a expensive call to node_load to prevent deleting the current revision instead we can just query the node table based on node id and get the revision id(vid) back.

Proposed resolution
$node = db_select('node', 'n')
->fields('n', array('vid'))
->condition('nid', $revision->nid,'=')
->execute()
->fetchObject();

CommentFileSizeAuthor
#2 node-revision-delete-2608640-1-7.x.patch634 bytessubson

Comments

subson created an issue. See original summary.

subson’s picture

StatusFileSize
new634 bytes
subson’s picture

Status: Active » Needs review
subson’s picture

Issue summary: View changes

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.