Error when saving new translations

Created on 27 November 2020, over 3 years ago
Updated 23 January 2023, over 1 year ago

Problem/Motivation

When saving a node (or translation) the module checks the machine_name to be unique.
This check tries to load a node with the submitted machine name and the current language.
That translation does not yet exist (you are about to create it) and it results in an error.

Proposed resolution

Before trying to load the translation, check if it exists. Otherwise return NULL.
Create a dedicated method for checking machine names without actually loading nodes.

Remaining tasks

Review patch.

User interface changes

None.

API changes

New method 'isMachineNameUsed' will be available.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇷🇴Romania reszli Târgu Mureș

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024