1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00

Fix issue in InputfieldSelect where non-default language label for optional "Please select" label was not translated when options are added using a newline-separated string.

This commit is contained in:
Ryan Cramer
2023-03-08 07:59:02 -05:00
parent d2cde11e4d
commit 592a443bf1

View File

@@ -8,7 +8,7 @@
* Sublcasses will want to override the render method, but it's not necessary to override processInput().
* Subclasses that select multiple values should implement the InputfieldHasArrayValue interface.
*
* ProcessWire 3.x, Copyright 2022 by Ryan Cramer
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
* https://processwire.com
*
* @property string|int $defaultValue
@@ -292,7 +292,7 @@ class InputfieldSelect extends Inputfield implements InputfieldHasSelectableOpti
$line = trim($line);
$line = ltrim($line, '+');
if(strpos($line, 'disabled:') === 0) list(,$line) = explode('disabled:', $line, 2);
if(!strpos($line, '=')) continue; // 0 or false OK
if(strpos($line, '=') === false) continue;
list($key, $label) = explode('=', $line, 2);
if($languageID) {
$this->optionLanguageLabel($languageID, $key, $label);