? PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar antonbag
antonbag
6 Sep 2023

Added two checkers:
if empty
if is array.

The current file gives error 500 in api.

Pull Request for Issue # .

Summary of Changes

//added return on empty
if (empty($field->value)) {
return;
}

//API
//if api and array splits values
if (is_array($field->value)) {
foreach ($field->value as $key => $value) {
$field->apivalue[$value] = $options[$value];
}
} else {
//default values
$field->apivalue[$field->value] = $options[$field->value];
}

Testing Instructions

Actual result BEFORE applying this Pull Request

ERROR 500 on empty values with api query

Expected result AFTER applying this Pull Request

if multiple:
"name-of-list-field": {
"text": "value",
"text": "value",
...
}

if single:
"name-of-list-field": {
"text": "value"
}

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 6 Sep 2023
Category Front End Plugins
avatar antonbag antonbag - open - 6 Sep 2023
avatar antonbag antonbag - change - 6 Sep 2023
Status New Pending
avatar antonbag antonbag - change - 6 Sep 2023
The description was changed
avatar antonbag antonbag - edited - 6 Sep 2023
avatar antonbag antonbag - change - 6 Sep 2023
Labels Added: PR-4.3-dev
avatar Quy
Quy - comment - 18 Sep 2023

Please test PR #41777 which that also includes radio buttons.

avatar antonbag
antonbag - comment - 18 Sep 2023

Please test PR #41777 which that also includes radio buttons.

Tested and working perfect!

avatar richard67
richard67 - comment - 18 Sep 2023

Please test PR #41777 which that also includes radio buttons.

Tested and working perfect!

@antonbag Could you mark your test result in the issue tracker? For this, just go to https://issues.joomla.org/tracker/joomla-cms/41777 , then use the blue "Test this" button at the top left corner, then select your test result (success) and submit. Thanks in advance.

avatar alikon alikon - close - 18 Sep 2023
avatar alikon
alikon - comment - 18 Sep 2023

closing in favour of #41777

avatar alikon alikon - change - 18 Sep 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-09-18 12:02:03
Closed_By alikon
Labels Added: ?

Add a Comment

Login with GitHub to post a comment