MetaModels/attribute_translatedcheckbox

Broken ?

Closed this issue · 7 comments

Question:

Is this attribute since 9 month broken or just i have some trouble.

First take a look at this point: https://github.com/MetaModels/attribute_translatedcheckbox/blob/master/src/MetaModels/Attribute/TranslatedCheckbox/TranslatedCheckbox.php#L102

Explenation: Each time i try to get data from the Trans-Checkbox the attribute check if all data are set, and if not it will set it. So it will set an empty entry in the database to display that for this attribute, language and item no active flag is set.

And now see this: https://github.com/MetaModels/core/blame/master/src/MetaModels/Attribute/TranslatedReference.php#L345

Explanation: Each time an empty value (false == '' => true) is given, the code will skip it and will not create an empty entry in the database.

And now the Question: The attribute want to have an empty entry to fix all for himself, the parent attribute not, so i have trouble with saving the data, because the system can't set a value but want to check if we have an empty one which creates an wrong handling of the data in the save function.

With other words: I can't save a value for this attribute, because the saving of an empty value is not allowed.... how can we fix this?

empty value is not allowed

this is the current rule for all attributes

Maybe but not for this one.

we have MM call heute and you can make vorschläge

@stefanheimes und @zonky2
wie haben das Problem heute nochmal besprochen: im Gegensatz zum attribut_checkbox (untranslated), welches immer eine eigene Spalte im Model hat und somit automatisch "NULL-Werte erzeugt, ist das beim translated_checkbox nicht der Fall. Hier erhält jeder Wert einen eigenen Eintrag in der Übersetzungstabelle - z.Z für "null-Werte eben nicht.

Lösung: eine eigene getTranslatedDataFor, die die Speicherung von Null-Werten ermöglicht.

Cherry pick the "holes" commit from tabletext might be a solution?

jo, geht auch...

Was fixed in MetaModels/core@de223f4 and got released as 2.0.2