1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00

Fix issue in InputfieldSelector where it could display primary field label rather than template-context field label (when present) in situation where only one template is allowed and 'showFieldLabels' option is enabled.

This commit is contained in:
Ryan Cramer
2024-09-01 11:15:03 -04:00
parent 80f425f9da
commit 842eca45b9

View File

@@ -933,6 +933,10 @@ class InputfieldSelector extends Inputfield implements ConfigurableModule {
foreach($settings['customFields'] as $field) {
/** @var Field $field */
if($settings['showFieldLabels']) {
if($this->initTemplate) {
$f = $this->initTemplate->fieldgroup->getField($field, true);
if($f) $field = $f;
}
$label = $field->getLabel();
while(isset($customFields[$label])) $label .= ' ';
} else {