Open StefanAbel-OTOBO opened 1 year ago
ov147
The cause of this bug is a bit complicated, I will try to explain it.
TL;DR: When a field links to itself, the value handling is different, which causes a problem for fields holding values as an array.
The placeholder [% Data.DynamicField_DBField %]
is filled with the value of the field which is present when rendering the template. Usually, this is the value in the %Ticket
object, which is an array in case of e.g. Dynamic Field Database. When linking to itself, a special case appears: Here, the function DisplayValueRender()
is called, which returns, among other data, the Dynamic Field value as a string and overrules the Dynamic Field value stored in %Ticket
.
I see mainly two possible solutions, assuming that we do want to support linking to other dynamic fields:
DynamicField_DB_DisplayValue
to %Ticket
, holding the result of DisplayValueRender()
DisplayValueRender()
@svenoe What do you think about this?
When referring to another DF in a Link, it doesn't work if that field is a DynamicField Database. It does though, in case it calls its own value.
In the link-portion of a DF configuration, you can refer a different field value, in case you use [% Data.DynamicFieldSomeFieldName | uri %] When you have a DF DB "DBFieldWithRefToIDinAText" and Link to: https://myfqdn/otobo/index.pl?Action=AdminService;Subaction=ServiceEdit;ServiceID=[% Data.DynamicFieldDBFieldWithRefToIDinAText | uri %]
this works fine:
You can see the ID being taken from the field.
When you do that in a different DynamicField called "MyIDinAText", with the same Link: https://myfqdn/otobo/index.pl?Action=AdminService;Subaction=ServiceEdit;ServiceID=[% Data.DynamicField_DBFieldWithRefToIDinAText | uri %]
this does not work, as hovering shows an array issue:
In case I would refer to a different kind field (e.g. text) this would work nicely. As in the ticket history, the proper value (whatever you select as an Identifier for the DF DB) is stored and self-calling it in the same DF works, in my opinion this should also work from a different Dynamic Field.