29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-05-29 08:21:38 +00:00

[4] article field List on webservices (#42206)

* article fieldList on webservices

* Update plugins/fields/list/src/Extension/ListPlugin.php

i don't like elseif

Co-authored-by: Quy <quy@nomonkeybiz.com>

---------

Co-authored-by: Quy <quy@nomonkeybiz.com>
This commit is contained in:
Nicola Galgano 2023-10-30 17:27:06 +01:00 committed by GitHub
parent bd01f10ddc
commit 637e22bd0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,10 +47,12 @@ final class ListPlugin extends FieldsListPlugin
$options = $this->getOptionsFromField($field);
$field->apivalue = [];
if (is_array($field->value)) {
if (\is_array($field->value)) {
foreach ($field->value as $value) {
$field->apivalue[$value] = $options[$value];
}
} elseif (!empty($field->value)) {
$field->apivalue[$field->value] = $options[$field->value];
}
}