Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After #2412569: Allow setting the auto-create bundle on entity reference fields with multiple target bundles selecting the bundle(s) of any entity type the ajax request is triggered and calls \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::validateConfigurationForm
which expects form states values to be set as ER Field setting and it broke the DER field setting form.
Proposed resolution
Fix the DER field setting form.
Remaining tasks
Fix the test fails and bug.
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#16 | field_setting_form_is-2712545-16.patch | 11.65 KB | jibran |
Comments
Comment #2
jibranWhile working on #2469609: Convert all WebTestBase to BrowserTestBase I found this bug. @larowlan can you please have look at it?
Comment #7
larowlanOk
Comment #8
OnkelTem CreditAttribution: OnkelTem commentedI have a related issue.
the if-part never triggers here on Drupal 8.0.5.
Particularly,
$parents = $triggering_element['#parents'];
results to['submit']
array i.e. w/o 'settings'.Comment #9
OnkelTem CreditAttribution: OnkelTem commentedI've checked the patch with the latest Drupal 8.1.x (thinking that the patch logic rely on some latest changes) and it doesn't seem to work properly - the
if
-content is still unreachable.For example, if you create a DER field referencing a non-bundled entity like "User", then settings>user>handler_settings>target_bundles will get value of "[]", which prevents autocomplete to work as it expects either not empty array of bundles or NULL (which obviously would happen in the 320th line if it was called).
Comment #10
OnkelTem CreditAttribution: OnkelTem commentedWhat do you think:
Comment #11
jibranThanks @OnkelTem. I think #10 makes a lot of sense. If you can do a patch it'd be great but if not I'll have a look at it on weekend if Lee won't beat me to it.
Comment #12
jibran@OnkelTem can you try this?
Comment #15
jibran:/
Comment #16
jibranHere is a green patch.
Comment #17
larowlanc/p issue
other than that, rtbc
great work
Comment #19
jibranThanks @larowlan for the review.
Fixed on commit
Comment #21
jibran