-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
2.1.3
-
None
-
None
Steps to reproduce
- Create a page with component variants on them.
- Copy the page
- On the copy try to remove a variant
Caused by: java.lang.IllegalStateException: Encountered more unregistrations than registration for the same parent page with id: e1ec6a69-40ea-4583-95e1-18a7ccd5be3f
at info.magnolia.personalization.variant.PersonalizedPages.unregisterParentPage(PersonalizedPages.java:121) ~[magnolia-personalization-core-2.1.3.jar:?]
at info.magnolia.personalization.variant.PersonalizedPages.unregisterNodeWithVariants(PersonalizedPages.java:113) ~[magnolia-personalization-core-2.1.3.jar:?]
at info.magnolia.personalization.variant.BaseVariantManager.removeHasVariantMixin(BaseVariantManager.java:76) ~[magnolia-personalization-core-2.1.3.jar:?]
at info.magnolia.personalization.variant.BaseVariantManager.deleteVariant(BaseVariantManager.java:59) ~[magnolia-personalization-core-2.1.3.jar:?]
at com.machinezoo.noexception.CheckedExceptionHandler$CheckedConsumer.accept(CheckedExceptionHandler.java:313) ~[noexception-1.4.4.jar:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_301]
at info.magnolia.pages.app.detail.action.DeleteElementVariantAction.lambda$execute$0(DeleteElementVariantAction.java:57) ~[magnolia-personalization-pages-2.1.3.jar:?]
at com.machinezoo.noexception.CheckedExceptionHandler$CheckedConsumer.accept(CheckedExceptionHandler.java:313) ~[noexception-1.4.4.jar:?]
at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_301]
at info.magnolia.pages.app.detail.action.DeleteElementVariantAction.execute(DeleteElementVariantAction.java:51) ~[magnolia-personalization-pages-2.1.3.jar:?]
at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62) ~[magnolia-ui-api-6.2.21.jar:?]
... 165 more
Expected results
The variant is removed.
Actual results
An exception is thrown and shown in the UI.
Workaround
Restart the magnolia instance.
Development notes
This problem is caused by info.magnolia.personalization.variant.PersonalizedPages
The cache it maintains does not notice when pages with personalization are created in the website that do not go through the addVariant code of the VariantManager.
As both copying as importing don't do that, the cache gets inconsistent and does not register the page. This causes unregisterParentPage(Node node) to fail, because it uses 0 for a page that actually has variants but is not in the cache.
It would be better to recheck if the page actually has variants or not in that case.
- caused by
-
MGNLPN-560 Further Improve performance of VariantAwareTitleColumnDefinition
- Closed
- relates to
-
MGNLPN-700 Removing all variants from a page doesn't remove hasVariants mixin type
- Open
-
MGNLPN-710 Delete all variants action fails when component is copied between pages
- Open