Published state for translated node

Created on 29 June 2023, about 2 years ago

Problem/Motivation

Setting the "Published (status)" target against a source (which is tampered as "Convert to Boolean", only alters the default/English language node and leaves the translated node as published.

Steps to reproduce

Preface: it is assumed you have Drupal 9.5.9 installed with all needed language modules set up, and at least 1 additional language installed, with the article content type set to be translatable.

1. Create a new feed type using the "Upload file" fetcher, and "JsonPath" parser, Node processor, and article content type
2. Add the mapping as stated (per the attached JSON example):
- "Published (status)" target to "status" source
- "Published (status)" target to "status" source, configured setting set to French
- "Title (title)" to "title_english"
- "Title (title)" to "title_french", configured setting set to French
- "Body (body): Text" to "type"
3. Context should be set to "$.items.*"
4. Save and edit tamper
- On "status -> Published: value" add "Convert to Boolean" tamper
- Truth set to "Active", False set to "Inactive"
- Submit changes
4. Create new feed based on the type just created.
5. Import items
6. Observe the 2 nodes imported with translations. The item with the "Inactive" status, is still published while english is unpublished

Other steps tried:
1. Setting language on all "Published" targets
2. Only having 1 "Published" target, in hopes it would apply to all

Proposed resolution

If "Published (status)" set as target, feeds should respect the language being set on and update accordingly.

🐛 Bug report
Status

Active

Component

Code

Created by

🇨🇦Canada nicole.harnish Halifax

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

Comments & Activities

  • Issue created by @nicole.harnish
  • 🇵🇸Palestine waleedagel

    Same problem.

  • I think i have the same problem with regular node feeds from csv.
    2 languages (default english, secondary swedish), published target (english) to csv source (status_en), published target (swedish) to csv source (status_sv).
    On first import all swedish nodes are set to default publishing option for content type. On second import (if values are changed in csv file) all values are as expected.

    This patch seems to fix the issue.

  • 🇨🇦Canada francismak

    Thank you for this patch. It is working properly. How we tested:

    1. Single feed CSV import to Node, English and French, with column TITLE_EN, TITLE_FR, PUBLISHED_EN and PUBLISHED_FR
    2. Configure the mapping of all columns, and set the relevant node languages
    3. Use 1 for True, 0 for False
    4. No tamper plugin used

    Be careful when using the tamper plugin "Set value or default value" with "Only if empty" enabled.
    It treats 0(zero) as empty.

Production build 0.71.5 2024