cancel
Showing results for 
Search instead for 
Did you mean: 

Bug to add groups to a site in Alfresco 7.3

mikef38
Champ on-the-rise
Champ on-the-rise

Hello,

I need an advice.

I installed Alfresco Community, v7.3.0 which was the current distribution few weeks ago and still is.

I cannot add groups to a site, because the search of groups from the "add group" page of the site will return nothing.

I tracked the problem in /alfresco-remote-api/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/site/membership/potentialmembers.get.js, mikolajbrzezinski added a faulty " [hint:useCQ]" which is not processed by the group search code, apparently withouth testing it on groups, since it absolutely doesn't work. There is a comment by luiscolorado and the problem is there since version 7.2.1 up to current one at least (7.3.0).

This was fixed by rrajoria in november, but the fix is not present in the distribution zip.

My question is:

This is a blocking problem, what is the correct way to handle it so that I can have a working installation being given that I do not intend to build my own custom version of the product, but that I could build and install an amp or an extension jar for instance ?

PS: I suggest that you put the fix in the public distribution kit asap, because this bug really breaks completely the site functionality...

Thank you

Michel

1 ACCEPTED ANSWER

When doing a minor upgrade (like this one) replacing the WARs and applying the extensions should be enough.

And, yes, you were to the right place. https://artifacts.alfresco.com is the official distribution site.

Hyland Developer Evangelist

View answer in original post

6 REPLIES 6

angelborroy
Community Manager Community Manager
Community Manager

I tested this with 7.3.1 and it works as expected. Are you able to upgrade to this version?

Hyland Developer Evangelist

I don't know, I can try. My entry point was the official page where there is only a link to 7.3.0-build-2019, but since now I know that there is version 7.3.1 I could google it and find where the distributions are stored. I hope that I went to the right place.

It should work, I'll just have to change the wars and reapply my extensions, I hope ?

When doing a minor upgrade (like this one) replacing the WARs and applying the extensions should be enough.

And, yes, you were to the right place. https://artifacts.alfresco.com is the official distribution site.

Hyland Developer Evangelist

Thank you, it works, and the script is indeed fixed in 7.3.1.

I don't know who is in charge of that, but it would be cool to update the official community download page, and also to put there a link to the distribution site. This page is flashy but really bad, hard to find information (I get lost each time) and missing the most important information.

Have a nice day!

Hi Angel,

yes, I can confirm that the group search has been fixed in 7.3.1, however, it is still impossible to add a group to the site...

As far as I understand the reason is a wrong order of js imports. We can't create an instance of Alfresco.GroupsList object before this object becomes available.

It looks like that:

...
<script type="text/javascript"> //<![CDATA[ new Alfresco.GroupsList("template_x002e_groupslist_x002e_add-groups_x0023_default").setOptions({ "roles": ["SiteManager", "SiteCollaborator", "SiteContributor", "SiteConsumer"], "siteId": "serhii-test" }).setMessages({ "groupslist.add": "Add", "groupslist.back-to": "back to Site Groups", "groupslist.or": "or", "role": "Role", "groupslist.selectrole": "Select Role", "button.add-groups": "Add Groups", "groupslist.title": "Add these Groups", "groupslist.empty-list": "Groups added here will be added", "message.result": "{0} groups added, {1} failures", "groupslist.selectallroles": "Set All Roles to" }); //]]> </script> ... <script type="text/javascript" src="/share/res/components/invite/groupslist_d0bad8cc4802deaf998d6f8492008cd3.js"></script> <script type="text/javascript" src="/share/res/components/people-finder/group-finder_7ccc009f612b7b8a426eb7f0182563d8.js"></script> <script type="text/javascript"> //<![CDATA[ new Alfresco.GroupFinder("template_x002e_group-finder_x002e_add-groups_x0023_default").setOptions({ "addButtonSuffix": ">>", "siteId": "serhii-test", "setFocus": true, "minSearchTermLength": 1.0, "maxSearchResults": 250.0, "dataWebScript": "api\/sites\/{siteId}\/potentialmembers?authorityType=GROUP" }).setMessages({ "label.users": "Users", "label.subgroups": "Subgroups", "message.instructions": "Enter a search term to find groups", "message.error": "Unable to perform group search", "title": "Find Groups to add to this site", "message.empty": "No groups found" }); //]]> </script>


That's why the left panel works correctly and the right panel doesn't.

Okay, it seems I found the issue, there is a missing "group" attribute on the tag "createWidgets" in the file org/alfresco/components/invite/groupslist.get.html.ftl

<@createWidgets/>


Quick workaround:

1. Create the following file 

/shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/invite/groupslist.get.html.ftl

2. Add content inside (the change highlighted in bold):

<@markup id="css" >
   <#-- CSS Dependencies -->
   <@link href="${url.context}/res/components/invite/groupslist.css" group="invite"/>
</@>

<@markup id="js">
   <#-- JavaScript Dependencies -->
   <@script src="${url.context}/res/components/invite/groupslist.js" group="invite"/>
</@>

<@markup id="widgets">
   <@createWidgets group="invite"/>
</@>

<@markup id="html">
   <@uniqueIdDiv>
      <div id="${args.htmlid}-grouplistWrapper" class="grouplistWrapper">
         <div class="title theme-color-2">${msg("groupslist.title")}</div>
         <div id="${args.htmlid}-groupslist" class="groupslist">
            <div id="${args.htmlid}-invitationBar" class="invitelist-bar">
               <button id="${args.htmlid}-selectallroles-button">${msg("groupslist.selectallroles")}&nbsp;&#9662;</button>
               <select id="${args.htmlid}-selectallroles-menu">
               <#list siteRoles as siteRole>
                  <option value="${siteRole}">${msg('role.' + siteRole)}</option>
               </#list>
               </select>
            </div>
            <div id="${args.htmlid}-inviteelist" class="body inviteelist theme-bg-color-6"></div>
            <div id="${args.htmlid}-role-column-template" style="display:none">
               <button class="role-selector-button" value="">${msg("role")}</button>
            </div>
         </div>
         <div class="sinvite">
            <button id="${args.htmlid}-add-button">${msg("button.add-groups")}</button>
            <span id="${args.htmlid}-backTo" class="back-to">${msg("groupslist.or")} <a href="site-groups">${msg("groupslist.back-to")}</a></span>
         </div>
      </div>
   </@>
</@>

3. Refresh Share webscripts or restart tomcat