Problem/Motivation
Follow up from #2412569: Allow setting the auto-create bundle on entity reference fields with multiple target bundles and #2712545: Field setting form is broken after 2412569. Bug priority is set as per the core issue.
Steps to reproduce
TBD
Proposed resolution
Copy the \Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget::getAutocreateBundle() logic into \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceWidget::getAutocreateBundle()
Remaining tasks
- Review.
- Maybe test once #3249331: Enable test for EntityReferenceAutocompleteWidget::getAutocreateBundle() in EntityReferenceAutoCreateTest::testMultipleTargetBundles() is fixed.
User interface changes
UI triggers warning if there is no 'auto_create_bundle'.
API changes
None.
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3249333-5.patch | 2.36 KB | jibran |
Comments
Comment #2
jibranComment #3
larowlanlet's return early here and avoid both the elseifs
Comment #4
jibranComment #5
jibranThanks for the review addressed #3.
Comment #6
larowlanComment #7
larowlanNice work
Comment #10
jibranThank you. Committed and pushed to both 2.x and 1.x.