No Code Attached Yet bug
avatar crystalenka
crystalenka
12 Aug 2022

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.

avatar crystalenka crystalenka - open - 12 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 12 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Aug 2022
avatar brianteeman
brianteeman - comment - 13 Aug 2022

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

avatar crystalenka
crystalenka - comment - 13 Aug 2022

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.

avatar crystalenka
crystalenka - comment - 13 Aug 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.

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment