Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Translation handling creates self-relating records #4380

Open
maufwind opened this issue May 16, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@maufwind
Copy link

commented May 16, 2019

Bug Report

There should never be a documents_translations record which is pointing from one document to the exact same.

Expected behavior

the column id and sourceId should not have the same value, because that relation is useless and can lead to bugs.

Actual behavior

they can have the same value.

Steps to reproduce

Scenario 1

Simply create a new document translation to the document itself in the backend. (yes it would be silly to do this, but why not check the id and throw an error before inserting it?)

Scenario 2

Let's say you have a document with the id 44 in german and one with id 45 in english. You link 44 with 45, which works well and looks like this in documents_translations:

'id', 'sourceId', 'language'
'45', '44', 'en'

If you open 45, you are able to also link it. If you link 45 with 44 the table documents_translations will contain these entries:

'id', 'sourceId', 'language'
'44', '44', 'de'
'45', '44', 'en'

where the de part points to itself.

Also, in general, it is not really clear why the table is build like this. Why a language column is needed? Why not use the document language instead? Why is the column a string instead of an id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.