Improve functional/unit test coverage to help document expected values

Created on 8 December 2018, over 6 years ago
Updated 13 March 2025, 20 days ago

Problem/Motivation

There are several issues that were created by users trying to use the module and marked postponed based on using the "render array" structure.

#3000005: Entity Reference and Taxonomy field
#3002037: Proper URL naming convention for 8.x-2.x entity forms
#2996126: Issue with entity reference
#2994467: Problem with the new prepopulate service and entity reference fields

It isn't obvious what the render array structure is when creating links for some use cases outlined there. For instance, it wasn't obvious that "edit[title][0][value]" wouldn't work for setting the node title because the render array tree is title > widget > 0 > value. It used to be easy to figure this out by looking at the name attribute on elements, but now a debugger is almost required.

Proposed resolution

I think it would greatly help developer experience to either

  1. Improve the documentation for 8.x-2.x based on the information from those issues, and/or
  2. Add tests to show that a particular link for a field works, which should help document the module

Remaining tasks

  • Review
  • Write better test cases, expand coverage
Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States mradcliffe USA

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.

  • 🇨🇦Canada joelpittet Vancouver

    @heddn thanks for adding checkboxes support, any idea why it's not whitelisted and implicitly unsafe in the tests? Scouring the code didn't help discern why.

Production build 0.71.5 2024