Closed HitmanInWis closed 5 years ago
I believe the solution would be to update:
@Reference(cardinality = ReferenceCardinality.MULTIPLE)
private transient Collection<SearchPredicate> searchPredicates;
to
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policyOption = ReferencePolicyOption.GREEDY)
private transient Collection<SearchPredicate> searchPredicates;
It also begs the question if similar changes should be made to other classes.
@HitmanInWis you wanna PR? i can but don't want to steal your commits since you did the hard work of tracking it down ;)
Agree we should do a sanity check of other @Reference's in the proj
Describe the bug If a bundle includes an implementation of
com.adobe.aem.commons.assetshare.search.searchpredicates.SearchPredicate
, thecom.adobe.aem.commons.assetshare.search.impl.datasources.SearchPredicatesDataSource
instance does not pick up the search predicate.This results in a case where a configured Search Restriction on the asset share results component will be lost if the author saves the dialog not realizing the custom Search Restriction is no longer valid.
This can be resolved manually by restarting the Asset Share bundle, but the reference is lost again if the custom bundle is reinstalled/restarted.
Environment
Expected behavior SearchPredicatesDataSource should always reflect the latest list of SearchPredicate implementations.