Link of folder not correct in the search result

Added by Diana George 600 days ago

When there is a folder in the search result and I try to open it with a click on it, I can't.
The url is not correct.

Can you help me ?

Thanks !

Best Regards,

Diana


Replies

RE: Link of folder not correct in the search result - Added by Aymen SAYHI 600 days ago

Hi Diana,

We'll take a look at it and we'll fix it as soon as possible.

In the meanwhile, you can add it as an issue here http://www.iptechinside.com/labs/projects/alfrescoshare/issues.

Best Regards,

RE: Link of folder not correct in the search result - Added by Diana George 599 days ago

Ok,

Thanks!

Best Regards,

Diana

RE: Link of folder not correct in the search result - Added by Diana George 584 days ago

Hi,

I've solved this problem.

In the file C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary\docsearch.get.js, I've wrote the function getSpaceNamePath :

/**
 * Returns the name path for a space
 */
function getSpaceNamePath(siteId, containerId, space, spaceNodeRef)
{
   // first find the container to which we are relative to
   var site = siteService.getSite(siteId);
   var container = site.getContainer(containerId);
   var folders = new Array();
   var spaceName;
   while (spaceNodeRef !== container.nodeRef)
   {
      space = space.parent;
      spaceNodeRef = space.nodeRef;
      spaceName = space.name;
      if(!spaceName.contains("documentLibrary"))
      {
         folders.push(spaceName);
      }
      else
      {
         spaceNodeRef = container.nodeRef;
      }
   }
   var path = "";
   for (var x = folders.length - 1; x >= 0; x--)
   {
      path += "/" + folders[x];
   }

   return path;
}
And I've changed :
path: defaultLocation.path,
with :
path: getSpaceNamePath(defaultLocation.site, defaultLocation.container, asset, asset.nodeRef),

Best Regards,
Diana

RE: Link of folder not correct in the search result - Added by Aymen SAYHI 584 days ago

Hi Diana,

Thank you for all the effort you're doing.

Before applying your fix, I tried to reproduce the issue wilth folder links but in vain, I couldn't, I found that it works perfectly.

Can you check it again please on a clean copy of alfresco on which you apply the advanced search extension ?

Best Regards,

RE: Link of folder not correct in the search result - Added by Diana George 584 days ago

Hi,

The problem appear when there is more folder levels.

For exemple :

/A |
/B |
/D |
/E

When I am on folder A and make a search, if in the result I have the folder E, I can't open it.

Diana

RE: Link of folder not correct in the search result - Added by Diana George 584 days ago

/A 
 |
 /B 
  |
  /D 
   |
   /E

Reply