Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-132128

Cannot utilize files or folders that contain '#' on Sharepoint

    Details

      Description

      Steps to Reproduce

      1. Set up Sharepoint on Liferay
      2. In the Sharepoint repository add a file with '#' (eg File#Test.docx)
      3. Navigate to Documents and Media and open the configured Sharepoint repository

      Expected Behavior: The user is able to see all the files in the Sharepoint repo.
      Actual Behavior: The user sees a blank Documents and Media page and the following error is thrown:

      2021-04-28 15:01:59.537 ERROR [https-jsse-nio-8443-exec-5][IncludeTag:128] Current URL /group/guest/~/control_panel/manage?p_p_id=com_liferay_document_library_web_portlet_DLAdminPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_document_library_web_portlet_DLAdminPortlet_mvcRenderCommandName=%2Fdocument_library%2Fview_folder&_com_liferay_document_library_web_portlet_DLAdminPortlet_redirect=https%3A%2F%2Flocalhost%3A8443%2Fgroup%2Fguest%2F~%2Fcontrol_panel%2Fmanage%3Fp_p_id%3Dcom_liferay_document_library_web_portlet_DLAdminPortlet%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview&_com_liferay_document_library_web_portlet_DLAdminPortlet_folderId=34714 generates exception: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.exception.PortalException: Unable to post to https://liferaycolab.sharepoint.com/_api/web/GetFileByServerRelativeUrl('/Documentos compartidos/Test PS#s.docx')/Versions: 400 Bad Request_{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"web/GetFileByServerRelativeUrl('/Documentos compartidos/Test PS\" is not valid."}}} [Sanitized]
      com.liferay.portal.kernel.exception.PortalException: Unable to post to https://liferaycolab.sharepoint.com/_api/web/GetFileByServerRelativeUrl('/Documentos compartidos/Test PS#s.docx')/Versions: 400 Bad Request_{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"web/GetFileByServerRelativeUrl('/Documentos compartidos/Test PS\" is not valid."}}} [Sanitized]
      	at com.liferay.sharepoint.rest.repository.internal.document.library.repository.external.SharepointExtRepository._handleHttpResponseError(SharepointExtRepository.java:782)
      	at com.liferay.sharepoint.rest.repository.internal.document.library.repository.external.SharepointExtRepository._getJSONObject(SharepointExtRepository.java:771)
      	at com.liferay.sharepoint.rest.repository.internal.document.library.repository.external.SharepointExtRepository.getExtRepositoryFileVersions(SharepointExtRepository.java:322)
      	at com.liferay.sharepoint.rest.repository.internal.document.library.repository.external.SharepointCachingExtRepository.getExtRepositoryFileVersions(SharepointCachingExtRepository.java:261)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter.getExtRepositoryFileVersionAdapters(ExtRepositoryAdapter.java:321)
      	at com.liferay.document.library.repository.external.model.ExtRepositoryFileEntryAdapter._getExtRepositoryFileVersionAdapters(ExtRepositoryFileEntryAdapter.java:397)
      	at com.liferay.document.library.repository.external.model.ExtRepositoryFileEntryAdapter.getFileVersions(ExtRepositoryFileEntryAdapter.java:152)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter._forceGetFileVersions(ExtRepositoryAdapter.java:1281)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter._toExtRepositoryObjectAdapter(ExtRepositoryAdapter.java:1464)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter._toExtRepositoryObjectAdapters(ExtRepositoryAdapter.java:1518)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter.getFoldersAndFileEntries(ExtRepositoryAdapter.java:604)
      	at com.liferay.document.library.repository.external.ExtRepositoryAdapter.getFoldersAndFileEntriesCount(ExtRepositoryAdapter.java:632)
      	at com.liferay.portal.kernel.repository.BaseRepositoryImpl.getFoldersAndFileEntriesAndFileShortcutsCount(BaseRepositoryImpl.java:242)
      	at com.liferay.portal.kernel.repository.Repository.getFoldersAndFileEntriesAndFileShortcutsCount(Repository.java:115)
      	at com.liferay.portal.repository.util.RepositoryWrapper.getFoldersAndFileEntriesAndFileShortcutsCount(RepositoryWrapper.java:448)
      	at com.liferay.portal.repository.capabilities.CapabilityRepository.getFoldersAndFileEntriesAndFileShortcutsCount(CapabilityRepository.java:572)
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.getFoldersAndFileEntriesAndFileShortcutsCount(DLAppServiceImpl.java:1675)
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.getFoldersAndFileEntriesAndFileShortcutsCount(DLAppServiceImpl.java:1662)
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.getFoldersAndFileEntriesAndFileShortcutsCount(DLAppServiceImpl.java:1652)
      	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
      

        Attachments

          Activity

            People

            Assignee:
            team-lima Product Team Lima
            Reporter:
            jonathan.mccann Jonathan McCann
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Jonathan McCann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              18 weeks, 4 days ago

                Packages

                Version Package
                7.2.X
                7.3.7 CE GA8
                7.3.X
                7.4.1 CE GA2 DXP 7,4
                Master