Problem/Motivation
At the moment, \Drupal\field_ui\Form\FieldStorageAddForm::buildForm retrieves the field category information from hook_field_type_category_info. It might make sense to retrieve this information in \Drupal\Core\Field\FieldTypePluginManager::getGroupedDefinitions.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3371301-3.patch | 8.48 KB | lauriii |
Issue fork drupal-3371301
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3371301-retrieve-field-type
changes, plain diff MR !4459
Comments
Comment #2
amateescu commentedComment #3
lauriiiI realized it would be pretty nice if we could retain the existing behavior of this method because there are existing calls in contrib. Here's a patch that reverts back to the old behavior, which I think probably would be the most sensible thing to do for now.
Maybe we'd like to introduce something on top of this so that
\Drupal\field_ui\Form\FieldStorageAddForm::buildFormdidn't have to triggerhook_field_type_category_infodirectly.Comment #4
smustgrave commentedThis something that could use a change record for the new parameter?
Comment #5
lauriiiWrote a draft CR 👍
Comment #6
smustgrave commentedThanks! CR looks good.
Comment #7
lauriiiComment #8
longwaveI think this comment should mention the special
keyvalue that is also available.Comment #9
lauriiiWe don't have to do #8 if we get #3372097: Consider replacing hook_field_type_category_info with YML based plugin discovery in first. Postponing this until that has been committed.
Comment #10
longwave#3372097: Consider replacing hook_field_type_category_info with YML based plugin discovery landed, this needs merging with the changes there.
Comment #11
longwaveComment #14
srishtiiee commentedRerolled patch #3 in MR !4459
Comment #15
smustgrave commentedCan file.module line 1301 also use the constant?
Comment #16
srishtiiee commentedRE:#15 I don't think we can replace it with the
FALLBACK_CATEGORYconstant as it is unrelated to the field type category system.Comment #17
smustgrave commentedMy question in #15 was answered.
Comment #18
longwaveAdded a comment about the assertion testing.
Comment #19
longwaveOn second thoughts let's just fix that in the linked issue, it doesn't need to hold this up.
Comment #20
longwaveCommitted e8568a2 and pushed to 11.x. Thanks!
Comment #24
quietone commentedPublished change record.