The cloned node is published by default regardless of its status

Created on 6 December 2023, about 1 year ago
Updated 12 December 2023, about 1 year ago

Problem/Motivation

I am testing in Drupal 10.1.6 and entity_clone 2.0.0-beta4 and when cloning an unpublished node, the clone applies the Published status by default, including its translations.

Proposed resolution

In src/Form/EntityCloneForm.php replace $translation->set($status_field, $form_state->getValue('status')); by
$translation->set($status_field, !($this->entity->getTranslation($translation_language->getId())->get($status_field)->value === "0"));

🐛 Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇨🇺Cuba ccolumbie

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

Comments & Activities

Production build 0.71.5 2024