Problem/Motivation

Reported here and here

When cancelling a user account and reassigning the author of revisions, a lot of additional revisions are created and the 'revision_translation_affected' field doesn't seem to be retained.

Steps to reproduce:

  • Login with an account that can be cancelled.
  • Create some content and translations as that user.
  • Cancel the account and reassign the content to the anonymous user.
  • Additional revisions are created and the 'revision_translation_affected' is reset (not sure what the impact of this is yet).

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Sam152 created an issue. See original summary.

plach’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

The IS needs an update based on the linked information, however if the reported issues are confirmed, this seems critical to me as we would be talking about data integrity issues.

plach’s picture

Priority: Normal » Critical

Tentatively marking this critical so we don't lose track of it.

sam152’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs issue summary update

I can confirm there are some weird results when cancelling a user account. The node revision list before and after reassigning an account:

mysql> select * from node_field_revision;
+-----+-----+----------+--------+-----+-------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
| nid | vid | langcode | status | uid | title | created    | changed    | promote | sticky | default_langcode | revision_translation_affected | content_translation_source | content_translation_outdated |
+-----+-----+----------+--------+-----+-------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
|   1 |   1 | en       |      0 |   2 | Test  | 1565335142 | 1565335149 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   2 | en       |      1 |   2 | Test  | 1565335142 | 1565335191 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   3 | en       |      1 |   2 | Test  | 1565335142 | 1565335197 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   4 | ca       |      0 |   2 | Test  | 1565335201 | 1565335207 |       1 |      0 |                0 |                             1 | en                         |                            0 |
|   1 |   4 | en       |      1 |   2 | Test  | 1565335142 | 1565335197 |       1 |      0 |                1 |                          NULL | und                        |                            0 |
+-----+-----+----------+--------+-----+-------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
5 rows in set (0.00 sec)

mysql> mysql> select * from node_field_revision;
+-----+-----+----------+--------+-----+----------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
| nid | vid | langcode | status | uid | title    | created    | changed    | promote | sticky | default_langcode | revision_translation_affected | content_translation_source | content_translation_outdated |
+-----+-----+----------+--------+-----+----------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
|   1 |   6 | en       |      0 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   7 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   8 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |   9 | ca       |      0 |   0 | Test     | 1565335201 | 1565335632 |       1 |      0 |                0 |                             1 | en                         |                            0 |
|   1 |   9 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |  10 | ca       |      0 |   0 | Test     | 1565335201 | 1565335632 |       1 |      0 |                0 |                             1 | en                         |                            0 |
|   1 |  10 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |  11 | ca       |      0 |   0 | Test123  | 1565335201 | 1565335632 |       1 |      0 |                0 |                             1 | en                         |                            0 |
|   1 |  11 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
|   1 |  12 | ca       |      0 |   0 | Test123  | 1565335201 | 1565335632 |       1 |      0 |                0 |                             1 | en                         |                            0 |
|   1 |  12 | en       |      1 |   0 | Test     | 1565335142 | 1565335632 |       1 |      0 |                1 |                             1 | und                        |                            0 |
+-----+-----+----------+--------+-----+----------+------------+------------+---------+--------+------------------+-------------------------------+----------------------------+------------------------------+
11 rows in set (0.00 sec)

A lot of additional revisions are created when reassigning each revision. revision_translation_affected seems to get reassigned to '1' for all revisions as well.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

vannergard’s picture

This also seems to effect nodes that previously changed owners. Meaning that even when a node has a new owner it will be reassigned to Anonymus if it ever has been owned by the user that user_cancel is run on.

catch’s picture

sam152’s picture

I believe this is primarily because when each revision is updated, content moderation forces a new revision to be created. There might be other bugs that come into play during the update, but I think that explains the large number of extra revisions after cancelling the account.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

yuseferi’s picture

I have this issue on Drupal 9.3.2 ,
content moderation and when I delete a translation it's happening

stephencamilo’s picture

Status: Active » Closed (won't fix)
rkoller’s picture

Status: Closed (won't fix) » Active

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.