[MAGNOLIA-7803] Multibinding in different scopes Created: 18/May/20  Updated: 04/Jun/20  Resolved: 26/May/20

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.0
Fix Version/s: 6.2.2

Type: Bug Priority: Neutral
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2d 2h 26m
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLUI-5851 Customizable form field layout compon... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: UI FW 3

 Description   
  • Registering a multibinded component in an UI scope (e.g. admicentral scope) results into:

     1) No implementation for info.magnolia.ui.framework.layout.field.FieldDescriptionProducer$Definition annotated with info.magnolia.ui.framework.ioc.AdmincentralImpl@3aa25edc was bound.

This can be workarounded with:

info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule#addMultiBinding
-        multiBinder.addBinding().to(key);
+        multiBinder.addBinding().to(key.getTypeLiteral());

This allow usage both main and admincentral scopes.

Usage of other scopes is still not possible though, defining a multibinding e.g. in the app-pages-app scope results into

Caused by: info.magnolia.objectfactory.MgnlInstantiationException: Failed to resolve param [0] of type [interface java.util.Set]

in both admicentral and app scopes ("destroys working multibinded component for admicentral as well".



 Comments   
Comment by Jesus Alonso [ 04/Jun/20 ]

Live-copy FieldProtectStatusProducer (see https://git.magnolia-cms.com/projects/ADDON/repos/live-copy/pull-requests/74/overview) uses app-pages-app-detail scope and it works fine.

Generated at Mon Feb 12 04:26:58 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.