Multiple field items returning null

Created on 23 November 2022, over 1 year ago
Updated 17 December 2023, 6 months ago

Problem/Motivation

Multiple primitive items (eg string, text, file) are returning weird nulls or arrays. On digging it appears to be a deeper issue on how multiples are handled.

Steps to reproduce

- Create field "text" with single value
- Create field "texts" with unlimited value

Result is lots of nulls in the wrong places (screenshots attached)

Proposed resolution

- Change all DataManager fields to use a common structure of field -> value/plugin
- Introduce FieldProducerPluginBase and that accepts resolve(FieldItemListInterface)
- Add FieldProducerPluginInterface that adds function resolveFieldItem(FieldItemInterface)
- Process each item in a field and return as single or array based on field definition.
- Remove field_first and entity_reference switching
- Add a hook to help extension of results

Remaining tasks

- Unsure if metatag works, i didnt alter it, but i also didnt get it to work?
- A few functions in DataManager are missing doc blocks. Unsure of their descriptions.

User interface changes

- NA

API changes

- Cleanup DataManager, add reusable functionality for fields definitions.
- Add DI in DataManager

Data model changes

- Quite a few. But at a minimum, multiple fields now work.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia AlMunnings Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024