No Code Attached Yet ?
avatar antonbag
antonbag
30 Aug 2022

Steps to reproduce the issue

  1. Create a Content Field of type List with Multiple Values (Multiple option as Yes) called "myfields" (for example).
  2. Enter two or more values in "List Values"
  3. Create an Article and in the Fields Tab, select multiple fields and save
  4. Call with the API to the created ID article {{base_url}}/{{base_path}}/content/articles/your article id

Expected result

A json list with data

Actual result

"errors": {
"code": 500,
"title": "Internal server error",
"detail": "TypeError: Illegal offset type in

System information (as much as possible)

Php 8.0
Joomla J4.2

Additional comments

The problem is in onCustomFieldsBeforePrepareField from list.php.
in the line $field->apivalue = [$field->value => $options[$field->value]];
if $field->value is multiple (an array), it returns error.

avatar antonbag antonbag - open - 30 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Aug 2022
avatar richard67
richard67 - comment - 30 Aug 2022

@antonbag Could you add some information to the title after the workd "with" so we know by the title what the issue is about? Thanks in advance.

avatar antonbag antonbag - change - 30 Aug 2022
Title
Api error with
Api error in Content Field plugin with multiple values
avatar antonbag antonbag - edited - 30 Aug 2022
avatar antonbag
antonbag - comment - 30 Aug 2022

Done. Sorry... I forgot it :/
Thank you! :)

avatar alikon alikon - change - 31 Aug 2022
Labels Added: ?
avatar alikon alikon - labeled - 31 Aug 2022
avatar alikon
alikon - comment - 31 Aug 2022

please test #38655

avatar alikon alikon - change - 31 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-31 14:00:55
Closed_By alikon
avatar alikon alikon - close - 31 Aug 2022
avatar Lakshay-Pruthi
Lakshay-Pruthi - comment - 19 Sep 2022

@antonbag Can you help me with step 3 and 4?
I have completed till step 2
image
Can you brief step 3 and 4?

avatar antonbag
antonbag - comment - 19 Sep 2022

image

In the Article, select multiple:
image

When I get the data from API in Postman, I get nothing (because is an array):
image

This is fixed in #38655

avatar Lakshay-Pruthi
Lakshay-Pruthi - comment - 20 Sep 2022

Completed step 3.
I am little confused about the URL
image
This is what my article page looks like.
If I'm not wrong Base URL will be "http://localhost/joomla"
Article ID is 1
what is the base path?

Add a Comment

Login with GitHub to post a comment