Skip to content

Conversation

@thomas-Ngr
Copy link
Contributor

@thomas-Ngr thomas-Ngr commented Jan 15, 2026

FIX concatenation of labels in extrafields

Follows discussion in PR #36835

IF:

  • The extrafield is of type "Select from list"
  • AND it would use a join as table
  • AND the label would be a concatenation of fields from both tables THEN, the EF value could not be displayed (showOutputField os showInputField).

example of syntax that would trigger this error :

commande c INNER JOIN llx_societe s ON s.rowid = c.fk_soc:s.nom|c.ref:c.rowid::

output :

Peek 15-01-2026 10-39

This commit fixes this.

IF:
- The extrafield is of type "Select from list"
- AND it would use a join as table
- AND the label would be a concatenation of fields from both tables
THEN, the EF value could not be displayed (showOutputField os showInputField).

example of syntax that would trigger this error : `commande c INNER JOIN llx_societe s ON s.rowid = c.fk_soc:s.nom|c.ref:c.rowid::`

This commit fixes this.
if (is_array($fields_label) && count($fields_label) > 1) {
$notrans = true;
foreach ($fields_label as $field_toshow) {
$field_toshow = preg_replace('/^.*\./', '', $field_toshow);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imagine the field to concat is
s.rowid|c.note
With pfix, you will get
rowid|label
But rowid field like note may be both in table s and c. So final request may generate an error with error "ambiguous field". Why keeping the alias is wrong ?

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Discussion Some questions or discussions are opened and wait answers of author or other people to be processed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants