When a node is translatable, it's possible you have two edit screens open from the same node, but in a different language.
The tempstore has no clue about the language, so hitting preview might overwrite the node stored in tempstore.

- Open two languages for the same node in two tabs
- http://localhost/en/node/1/edit
- http://localhost/fr/node/1/edit
- press preview on the french one, then preview in the english one
- Press back to editing in the french one, you are now editing in English

Borderline critical as there is data loss involved here.

Members fund testing for the Drupal project. Drupal Association Learn more


swentel created an issue. See original summary.

swentel’s picture

Status: Active » Needs review
1.55 KB
swentel’s picture

Issue summary: View changes
swentel’s picture

Title: Previewing nodes » Previewing translatable nodes can leed to data loss

Note: the save() method should also be changed

$store->delete($node->uuid() . '-' . $node->language()->getId());

swentel’s picture

Title: Previewing translatable nodes can leed to data loss » Previewing translatable nodes can lead to data loss
timmillwood’s picture

Issue tags: +Needs tests

Nice find, the patch looks pretty simple, but we'll need tests for it.

Status: Needs review » Needs work

The last submitted patch, 2: 2907091-2.patch, failed testing. View results

cilefen’s picture

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.