Error when saving new translations

Created on 27 November 2020, about 4 years ago
Updated 23 January 2023, almost 2 years 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.71.5 2024