Is there an alternative to the 'Liferay.Util.selectEntity' function?
knowledge-article-header-disclaimer-how-to
knowledge-article-header-disclaimer
legacy-article
learn-legacy-article-disclaimer-text
Issue
- After upgrading to 2024.Q2+,
Liferay.Util.selectEntity
does not work anymore. It has been removed, according to the 2024.Q2 Breaking Changes.
- Is there any replacement for it?
Resolution
- Although it has been removed as of 2024.Q2, the replacement was made a few years ago in LPS-112298 Update Liferay.Util.selectEntity utility, as part of the epic LPS-101984 Provide Modal Patterns matching Lexicon Definition, where you can find more information.
- Within the product, usages of
Liferay.Util.selectEntity
(AUI-based) were replaced by Liferay.Util.openModal
(Clay-based). You can find the changes in this pull request. For example (FragmentCompositionDropdownDefaultEventHandler.es.js
):
- Before
Liferay.Util.selectEntity(
{
dialog: {
constrain: true,
destroyOnHide: true,
modal: true,
},
eventName: this.ns('selectFragmentCollection'),
id: this.ns('selectFragmentCollection'),
title: Liferay.Language.get('select-collection'),
uri: selectFragmentCollectionURL,
},
(selectedItem) => {
if (selectedItem) {
...
}
}
);
- After
Liferay.Util.openModal({
id: this.ns('selectFragmentCollection'),
onSelect: (selectedItem) => {
if (selectedItem) {
...
}
},
selectEventName: this.ns('selectFragmentCollection'),
title: Liferay.Language.get('select-collection'),
url: selectFragmentCollectionURL,
});
did-this-article-resolve-your-issue