As discovered in #2952529-29: Support for Layout Builder module (for products) entity reference target bundles should have identical keys and values. This means that the following update should be done to allow the layout builder to work for commerce orders:

-      ->setSetting('handler_settings', ['target_bundles' => ['customer']])
+      ->setSetting('handler_settings', ['target_bundles' => ['customer' => 'customer']])

Comments

Neograph734 created an issue. See original summary.

neograph734’s picture

Status: Active » Needs review
StatusFileSize
new717 bytes
neograph734’s picture

Issue summary: View changes
neograph734’s picture

StatusFileSize
new799 bytes

Not sure how I got the patch for shipment under this issue number...

neograph734’s picture

Adding this is a child issue of Commerce #2952529: Support for Layout Builder module.

mglaman’s picture

StatusFileSize
new1.41 KB

PaymentMethod has the same problem.

Drupal core is also inconsistent.

  • mglaman committed 38283c6 on 8.x-2.x authored by Neograph734
    Issue #3137225 by Neograph734, mglaman: Target bundles for entity...
mglaman’s picture

Status: Needs review » Fixed

Committed, thanks!

neograph734’s picture

No problem, thanks for committing.

Drupal core is also inconsistent.

It's been a while, but I believe core was using array_keys() at some point, where it was using the values at other places. Back then I felt array_keys should not have been used there. But since core is using double (key/value) notations in most of its tests, I was not sure enough to report an issue and assumed it was by design. (Still does not make sense to me though)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.