Change output for single-value text fields
2 unresolved threads
2 unresolved threads
Closes #3500967
Merge request reports
Activity
46 46 $element->setAttribute($key ?: $field_item_list->getName(), $attributes[$first_key]); 47 47 } 48 48 } 49 // If the element has a single slot, just add that. 49 // If the element has a single slot, just add that 50 // - explicitly as a single value, if the slot contains a single value; 51 // - otherwise, add all values from the slot. I wasn't sure if I should add a comment here like "note that an array value produces invalid JSON output".
Edited by Roderik Muit
55 57 $tag = !empty($slot['tag']) ? $slot['tag'] : 'div'; 56 58 $element->setSlot($key ?: $field_item_list->getName(), $slot['content'], $tag, $attributes, $index); 57 59 } 60 if (count($slot_entries) == 1) { this is not a good idea, since it depends on the actual data. That means, one node might end-up with a simple normalization while the second does not. But this may NOT happen. We need to be able to have a frontend component that expects the data in ONE way.
I'd recommend moving this to a specialized processor for long-text items, such that it's turned "simple" only when the summary is disabled.
Please register or sign in to reply