Entity Reference Purger is not translation aware

Created on 16 March 2023, over 1 year ago
Updated 14 July 2023, 12 months ago

Problem/Motivation

There's no code in the module related to language. I'm fairly certain that this means that, especially when using the queue, it might or might not grab the expected language version of the entity. If it grabs the wrong version there will be data loss.

Steps to reproduce

Proposed resolution

Include the language in the queue record. Load that language.

Remaining tasks

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada dalin Guelph, 🇨🇦, 🌍

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

Comments & Activities

  • Issue created by @dalin
  • 🇮🇳India rajiv.singh

    Steps to produce issue before enabling the module.
    1. Install devel module.
    2. Translate a node (having entity/term reference field) in few available languages in the site.
    - suppose node is 100.
    3. Select a taxonomy term ( suppose tid is 1111)
    4. Save and publish the node.
    5. Do the same for its translations( Select the term, publish and save)
    6. Go to pages /[Language-code]/devel/node/100 (Example - /en/devel/node/100)
    7. On the devel page expand the accordion reading as VARIABLE
    8. Browser search (CTRL+F) the term id 1111.
    9. Now go to the term edit page /en/taxonomy/term/17341/edit and click on the delete link to delete it.
    10. Repeat step 6 to 8.
    11. The term id is still showing up in the variables.

    Enable the module Entity Reference Purger , Check the box Remove orphaned entity references under ENTITY REFERENCE PURGER at field configuration page /en/admin/structure/types/manage/[CONTENT-TYPE]/fields/[FIELD_MACHINE_NAME]
    - Repeat above steps after enabling the module , configuring field and deleting the term .
    Result: The translations are still having the term reference in the database.

    Solution:

    Apply the patch , clear cache and verify the same with above steps.

  • 🇮🇳India rajiv.singh

    Bug fixes in previous patch

  • 🇮🇳India rajiv.singh

    Code cleaned up of previous patch

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    2 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    2 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    2 pass
Production build 0.69.0 2024