Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292183

Limit APIs to FieldDefinitionInterface when FieldInstance isn't needed

$
0
0

Follow up from #1950632: Needs change notice: Create a FieldDefinitionInterface and use it for formatters and widgets. If code isn't specifically working with configuring Field API fields and instances (e.g., providing settings forms), then it has no business dealing with those objects/interfaces directly, and should instead interact only via FieldDefinitionInterface. That allows future core or contrib code to pass in nonconfigurable fields and still have everything work.

This doesn't fix all of core to do this, but does the parts that were found in the course of #1988612: Apply formatters and widgets to rendered entity base fields, starting with node.title. Extracting this part because it's an API change, so would be good to have land before API freeze, but the rest of that issue requires more work and review.

Because this includes changes to the getConstraints() methods of text field type classes, it also removes that method from TextWithSummaryItem and TextItemBase, and leaves it only on TextItem, since that is the only type that actually provides a max_length setting.

AttachmentSizeStatusTest resultOperations
field_definition.patch25.61 KBIdlePASSED: [[SimpleTest]]: [MySQL] 56,751 pass(es).View details | Re-test

Viewing all articles
Browse latest Browse all 292183

Trending Articles