Creating multi-language entities programmatically does not estimate read time for all translations

Created on 22 October 2023, about 1 year ago
Updated 7 March 2024, 10 months ago

Problem/Motivation

The estimated read time is calculated on presave of the entity. The estimation is only done for the current translation. Especially, when creating entities programmatically, one may want to create multiple translations at once. Then also the read time for other translations should be processed.

Steps to reproduce

See the failing test in πŸ“Œ Add kernel tests Needs review .

1. Create a node with a specified language.
2. Add a translation.
3. Save node.
4. The read time is only calculated for the specified language and not the translation.

Proposed resolution

In the presave check whether the entity implements the TranslatableInterface and if translations have changes by $translation->hasTranslationChanges(). Then estimate the read time for the translations.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany simonbaese Berlin

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024