Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[J4.x] Custom Field List returns inconsistent results when used in subform #38452

Open
crystalenka opened this issue Aug 12, 2022 · 3 comments
Open

Comments

@crystalenka
Copy link
Member

Steps to reproduce the issue

  1. Create a new custom field of type 'list'. Set multiple to 'no'. Set subform only to 'yes'. Add several unique options to the list.
  2. Create a new custom field of type 'subform'. Add your new list field to the subform. Make sure repeatable is set to 'yes'.
  3. Create an article where you can edit the custom field.
  4. Add several rows with different values set in the list.

Expected result

The custom field returns the raw value consistently, preferably as a string since it is not allowing multiples. An array with a single item would also work.

Actual result

The custom field returns the raw value inconsistently - sometimes as a string, sometimes as an array. I can work around it, but the inconsistent behavior feels like a bug.

System information (as much as possible)

Joomla 4.1.5
PHP 8

Additional comments

Happens regardless of list layout.

@brianteeman
Copy link
Contributor

Just a guess based on your screenshot. Is it always an array for the first and a string for subsequent values?

@crystalenka
Copy link
Member Author

It seems to be. Not sure what would happen if they were more mixed in as I had to get moving with the project and worked around it; I will have to experiment more later.

@crystalenka
Copy link
Member Author

crystalenka commented Aug 13, 2022

Just a guess based on your screenshot. Is it always an array for the first and a string for subsequent values?

Just played with it more; this is correct, @brianteeman. It doesn't seem to matter if they are not in subsequent order; the first time a certain value is used, it's always an array, and every other time the value is used it is a string.

@Hackwar Hackwar added the bug label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants