Closed amenk closed 1 year ago
@amenk Could you check the DB to see how "Frankfurt (Oder)" was saved - as entered or encoded?
Is it possible to select a real alias column for alias as well? It seems to be a MM table...
Is the relation table also multilingual and is "partner_name" multilingual?
@zonky2
1) It's saved in encoded form Frankfurt (Oder)
2) Yes it's a MM table -- my first thought was to select the alias or ID as well. But wouldn't we need to migrate the existing relations or does this happen automatically? - also I was not sure if this is an intended limitation and a field like name should just not be possible to use as relation.
3) Nothing seems to be multilanguage
Re 2) If I select "id" as the alias column (we don't have an alias) that would work, yes
You should always create an alias for relations - e.g. to have clean URL parameters for filtering.
I assume that the problem is with the encoding - I'll have to create a test case.
You can check this to change Frankfurt (Oder)
to Frankfurt (Oder)
directly in DB
okay, good to know - while I think we don't have filters on this field anyways.
When changing it in the database it does not help - same error. Also in the Backend Form it selects the first entry after we get the error.
hmm... o.k. - I can can check this after create a test case....
Background info: we have two methods widgetToValue and valueToWidget - when saving, the widgetToValue is executed first to check the value and then the valueToWidget - if the value is the same as the initial value, only then is it saved to the DB - otherwise the error message shown comes up.
The problem is that Contao automatically changes the text when saving it to the database - so Frankfurt (Oder)
becomes Frankfurt (Oder)
The conversion can be switched off in the settings of the attribute of the input mask, so that Frankfurt (Oder)
is saved in the DB.
In MM B, however, we cannot determine which setting was selected for MM A in the input mask or whether there were other conversions.
As written, an alias attribute should also be selected for Alias...
In MM we can't solve the problem - in the future the conversion before storing in the DB from Contao will be omitted - we welcome this very much and hope the "feature" will come in Contao 5
The conversion can be switched off in the settings of the attribute of the input mask, so that Frankfurt (Oder) is saved in the DB.
I tried to find such a setting in table=tl_metamodel_dcasetting&id=tl_metamodel_dcasetting
of MM A.
But I guess, there just is no other solution than creating an alias for now? I think I misunderstood the answer first :-) I think we will just create an alias.
Go to your related "MM B" and open the attribute "name" at input mask...
save your item with name Frankfurt (Oder)
and check the value at DB
save your item with name Frankfurt (Oder) and check the value at DB
Perfect, works :-)
Checklist before I submit this issue report
I confirm that:
My environment is:
(Please fill in the actual values from your environment - check Contao Manager or use
composer show
)Issue description
When selecting a metamodel reference which contains
( )
in the field name, it is not accepted.Steps to reproduce
Describe the behaviour of the application
Message:
Describe the expected behaviour of the application
The form can be saved
Workaround
Rename the entry to "Frankfurt - Oder" and chose it.
Also it might be possible to use the id field as reference instead of the name, but I guess we would need to migrate the references then?
Screenshots
Context
We have this in a Migration project from Countao 4.3 with an older Metamodels version. The data was copied to the new instance - so this might have worked in the older version of Contao / Metamodels.