loadRevision() can return null in batch deleteRevision()

Created on 14 August 2023, about 1 year ago
Updated 7 March 2024, 7 months ago

Problem/Motivation

I've got a run away automation that's bloated my db with a lot of node revisions. As I'm working through them, I'm noticing revisions that don't seem to get a node somehow?

Steps to reproduce

Not sure it's stuck in my db somewhere.

Proposed resolution

Seems like the only usage of `$node` in batch `deleteRevision()` is for logging, can we just check to see if $node is not null and do some better logging?

Remaining tasks

    $message = t('@current / @total - Revision @rid of node @nid - @lang - @title', [
      '@rid' => $revision,
      '@nid' => $node ? $node->id() : 'node not found',
      '@lang' => $node ? $node->language()->getId() : 'node not found',
      '@title' => $node ? $node->label() : 'node not found',
      '@current' => $context['results']['revisions'],
      '@total' => $total,
    ]);

None.

User interface changes

None.

API changes

None

Data model changes

None

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dmlb2000 Richland Washington

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dmlb2000
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • @dmlb2000 opened merge request.
  • πŸ‡¨πŸ‡¦Canada adriancid Montreal, Canada

    If there is a revision in the database this should be because there is a node for this revision, maybe you deleted with a query a node but forgot to delete the revisions?

  • Status changed to Closed: outdated 7 months ago
  • πŸ‡¨πŸ‡¦Canada adriancid Montreal, Canada

    Closing because the current development is being made in branch 2.x

Production build 0.71.5 2024