Skip to content

Commit

Permalink
LPS-206531 Using RepositoryId instead of themeDisplay in order to dis…
Browse files Browse the repository at this point in the history
…play the tags/categories assignable to the content.
  • Loading branch information
manuelRives authored and brianchandotcom committed Jan 30, 2024
1 parent 8b892ac commit 2704782
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,23 @@ public String getRememberCheckBoxStateURLRegex() {
"\\?");
}

public long getRepositoryGroupId(long scopeGroupId, long repositoryId) {
Repository repository = RepositoryLocalServiceUtil.fetchRepository(
repositoryId);

if (repository != null) {
return repository.getGroupId();
}

Group group = GroupLocalServiceUtil.fetchGroup(repositoryId);

if (group != null) {
return group.getGroupId();
}

return scopeGroupId;
}

public long getRepositoryId() {
if (_repositoryId != 0) {
return _repositoryId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,9 @@ private long[] _getGroupIds() {
_groupIds =
_siteConnectedGroupGroupProvider.
getCurrentAndAncestorSiteAndDepotGroupIds(
_themeDisplay.getScopeGroupId());
_dlAdminDisplayContext.getRepositoryGroupId(
_themeDisplay.getScopeGroupId(),
_dlAdminDisplayContext.getRepositoryId()));
}
catch (PortalException portalException) {
if (_log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,14 @@ renderResponse.setTitle(headerTitle);
className="<%= DLFileEntry.class.getName() %>"
classPK="<%= assetClassPK %>"
classTypePK="<%= (fileEntryTypeId < 0) ? DLFileEntryTypeConstants.FILE_ENTRY_TYPE_ID_BASIC_DOCUMENT : fileEntryTypeId %>"
groupIds="<%= SiteConnectedGroupGroupProviderUtil.getCurrentAndAncestorSiteAndDepotGroupIds(dlAdminDisplayContext.getRepositoryGroupId(scopeGroupId, repositoryId)) %>"
visibilityTypes="<%= AssetVocabularyConstants.VISIBILITY_TYPES %>"
/>

<liferay-asset:asset-tags-selector
className="<%= DLFileEntry.class.getName() %>"
classPK="<%= assetClassPK %>"
groupIds="<%= SiteConnectedGroupGroupProviderUtil.getCurrentAndAncestorSiteAndDepotGroupIds(dlAdminDisplayContext.getRepositoryGroupId(scopeGroupId, repositoryId)) %>"
/>

<c:if test="<%= (fileEntry != null) && dlAdminDisplayContext.isAutoTaggingEnabled() %>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ taglib uri="http://liferay.com/tld/react" prefix="react" %><%@
taglib uri="http://liferay.com/tld/user" prefix="liferay-user" %>

<%@ page import="com.liferay.bulk.selection.BulkSelectionRunner" %><%@
page import="com.liferay.depot.util.SiteConnectedGroupGroupProviderUtil" %><%@
page import="com.liferay.digital.signature.constants.DigitalSignaturePortletKeys" %><%@
page import="com.liferay.document.library.configuration.DLConfiguration" %><%@
page import="com.liferay.document.library.exception.DLFileEntryConfigurationException" %><%@
Expand Down

0 comments on commit 2704782

Please sign in to comment.