Uploaded image for project: 'PUBLIC - Liferay Social Office Community Edition'
  1. PUBLIC - Liferay Social Office Community Edition
  2. SOS-2400

Sites Directory does not display properly when viewed in French or Catalan

    Details

    • Fix Priority:
      4
    • Affects Portal Version/s:
      6.2.x, 6.2.0 CE GA1, 6.2.10 EE GA1

      Description

      Here are the steps to reproduce:

      1. Add the SO Role to Test Test
      2. Go to My Account -> Display Settings
      3. Set the language to French or Catalan
      4. View the Sites Directory

      Expected result:

      The Sites Directory will display properly

      Actual result:

      The list of sites will not be visible. The following error will also display:

      17:10:42,387 ERROR [http-bio-8081-exec-4][MinifierUtil:111] 241: 99: missing ; before statement
      17:10:42,388 ERROR [http-bio-8081-exec-4][MinifierUtil:111] 241: 130: unterminated string literal
      17:10:42,389 ERROR [http-bio-8081-exec-4][MinifierUtil:111] 242: 44: missing ; before statement
      17:10:42,389 ERROR [http-bio-8081-exec-4][MinifierUtil:111] 242: 60: unterminated string literal
      17:10:42,390 ERROR [http-bio-8081-exec-4][MinifierUtil:111] 1: 0: Compilation produced 4 syntax errors.
      17:10:42,390 ERROR [http-bio-8081-exec-4][MinifierUtil:88] JavaScript Minifier failed for__// <![CDATA[_AUI().use('datatype-number', 'liferay-so-site-list', function(A) {(function() {_        var directoryContainer = A.one('#_5_WAR_soportlet_directory');__        var navigationContainer = directoryContainer.all('.directory-navigation');__    var currentPageNode = directoryContainer.one('.page-indicator .current');_      var totalPageNode = directoryContainer.one('.page-indicator .total');__ var keywordsInput = directoryContainer.one('#_5_WAR_soportlet_dialogKeywords');_        var nextButton = directoryContainer.one('.search .next');_      var previousButton = directoryContainer.one('.search .previous');_      var sitesTabsSelect = directoryContainer.one('select[name=_5_WAR_soportlet_tabs1]');__  var directoryList = new Liferay.SO.SiteList(_           {_                      inputNode: '#_5_WAR_soportlet_directory #_5_WAR_soportlet_dialogKeywords',_                     listNode: '#_5_WAR_soportlet_directory .directory-list',_                       minQueryLength: 0,_                 requestTemplate: function(query) {_                         return {_                                       _5_WAR_soportlet_directory: true,_                                      _5_WAR_soportlet_end: 10,_                                      _5_WAR_soportlet_keywords: query,_                                      _5_WAR_soportlet_searchTab: sitesTabsSelect.get('value'),_                              _5_WAR_soportlet_start: 0_                              }_                      },_                     resultTextLocator: function(response) {_                                var result = '';__                      if (typeof response.toString != 'undefined') {_                                 result = response.toString();_                          }_                              else if (typeof response.responseText != 'undefined') {_                                        result = response.responseText;_                                }__                             return result;_         },_                     source: Liferay.SO.Sites.createDataSource('http://localhost:8081/web/guest/home?p_p_id=5_WAR_soportlet&p_p_lifecycle=2&p_p_state=exclusive&p_p_mode=view&p_p_resource_id=getSites&p_p_cacheability=cacheLevelPage', '_5_WAR_soportlet_')_               }_      );__    Liferay.SO.Sites.createDirectoryList(directoryList);__  directoryList.sendRequest();__  var updateDirectoryList = function(event) {_            var data = A.JSON.parse(event.data.responseText);__             var results = data.sites;_              var count = data.count;__               var options = data.options;__           var buffer = [];__              if (results.length == 0) {_                     buffer.push(_                           '<li class="empty">\u0049\u006c\u0020\u006e\u0027\u0079\u0020\u0061\u0020\u0061\u0075\u0063\u0075\u006e\u0020\u0072\u00e9\u0073\u0075\u006c\u0074\u0061\u0074\u002e</li>'_                      );_             }_              else {_                 var siteTemplate =_                             '<li class="{classNames}">' +_                                  '{favoriteHtml}' +_                                     '{joinHtml}' +_                             '{leaveHtml}' +_                                    '{requestHtml}' +_                                      '{requestedHtml}' +_                                    '{deleteHtml}' +_                               '<span class="name">{siteName}</span>' +_                                       '<span class="description">{siteDescription}</span>'_                           '</li>';__                  buffer.push(_                               A.Array.map(_                                   results,_                                       function(result, index) {_                                      var classNames = [];_                                           var joinHtml = '';__                                            if (result.socialOfficeGroup) {_                                                classNames.push('social-office-enabled');_                                              }__                                             if (!result.joinUrl) {_                                         classNames.push('member');_                                             }__                                             if ((index % 2) == 1) {_                                                classNames.push('alt');_                                                }__                                             var name = result.name;__                                               if (result.publicLayoutsURL) {_                                                 name = '<a href="' + result.publicLayoutsURL + '">' + name + '</a>';__                                                  if (result.privateLayoutsURL) {_                                                                name += '<a class="private-pages" href="' + result.privateLayoutsURL + '"> (\u0050\u0061\u0067\u0065\u0073\u0020\u0050\u0072\u0069\u0076\u00e9\u0065\u0073)</a>';_                                                      }_                                              }_                                          else if (!result.publicLayoutsURL && result.privateLayoutsURL) {_                                                   name = '<a href="' + result.privateLayoutsURL + '">' + name + '</a>';_                                  }__                                             return A.Lang.sub(_                                                     siteTemplate,_                                              {_                                                          classNames: classNames.join(' '),_                                                              deleteHtml: (result.deleteURL ? '<span class="action delete"><a class="delete-site" href="' + result.deleteURL + '">\u0045\u0066\u0066\u0061\u0063\u0065\u0072</a></span>' : '<span class="action-not-allowed"></span>'),_                                                      joinHtml: (result.joinUrl ? '<span class="action join"><a class="join-site" href="' + result.joinUrl + '">\u004a\u006f\u0069\u006e\u0064\u0072\u0065</a></span>' : ''),_                                                        leaveHtml: (result.leaveUrl ? '<span class="action leave"><a class="leave-site" href="' + result.leaveUrl + '">\u004c\u0061\u0069\u0073\u0073\u0065\u0072</a></span>' : ''),_                                                           requestHtml: (result.requestUrl ? '<span class="action request"><a class="request-site" href="' + result.requestUrl + '">\u0044\u0065\u006d\u0061\u006e\u0064\u0065\u0072\u0020\u0075\u006e\u0065\u0020\u0061\u0064\u0068\u00e9\u0073\u0069\u006f\u006e</a></span>' : ''),_                                                     requestedHtml: (result.membershipRequested ? '<span class="action requested"><a>\u0041\u0064\u0068\u00e9\u0073\u0069\u006f\u006e\u0020\u0064\u0065\u006d\u0061\u006e\u0064\u00e9\u0065</a></span>' : ''),_                                                              siteDescription: result.description,_                                                           siteName: name,_                                                        favoriteHtml: (result.favoriteURL ? '<span class="action favorite"><a class="favorite-site" href="' + result.favoriteURL + '">\u0066\u0061\u0076\u006f\u0072\u0069\u0074\u0065</a></span>' : '<span class="action unfavorite"><a class="unfavorite-site" href="' + result.unfavoriteURL + '">\u0075\u006e\u0066\u0061\u0076\u006f\u0072\u0069\u0074\u0065</a></span>')_                                         }__                                             );_                                     }_                              ).join('')_                     );_         }__         this._listNode.html(buffer.join(''));__         var currentPage = Math.floor(options.start/10) + 1;_            var totalPage = Math.ceil(count/10);__          currentPageNode.html(currentPage);_             totalPageNode.html(totalPage);__                if (currentPage <= 1) {_                        Liferay.SO.Sites.disableButton(previousButton);_                }_              else {_                 Liferay.SO.Sites.enableButton(previousButton);_         }__             if (currentPage >= totalPage) {_                        Liferay.SO.Sites.disableButton(nextButton);_        }_          else {_                 Liferay.SO.Sites.enableButton(nextButton);_             }_      };__    directoryList.on('results', updateDirectoryList);__     var getRequestTemplate = function(targetPage) {_                var start = (targetPage - 1) * 10;_             var end = start + 10;__         return function(query) {_                       return {_                               _5_WAR_soportlet_directory: true,_                              _5_WAR_soportlet_end: end,_                             _5_WAR_soportlet_keywords: query,_                              _5_WAR_soportlet_searchTab: sitesTabsSelect.get('value'),_                              _5_WAR_soportlet_start: start_                  }_              };_     };__    sitesTabsSelect.on(_            'change',_          function(event) {_                  directoryList.sendRequest();_           }_      );__    nextButton.on(_         'click',_               function(event) {_                      var currentPage = A.DataType.Number.parse(currentPageNode.html());_                     var totalPage = A.DataType.Number.parse(totalPageNode.html());__                        var targetPage = currentPage + 1;__             if (targetPage > totalPage) {_                          return;_                        }__                     directoryList.sendRequest(keywordsInput.get('value'), getRequestTemplate(targetPage));_         }_      );__    previousButton.on(_             'click',_               function(event)
       {_                     var currentPage = A.DataType.Number.parse(currentPageNode.html());__            var targetPage = currentPage - 1;__                     if (targetPage <= 0) {_                         return;_                        }__                     directoryList.sendRequest(keywordsInput.get('value'), getRequestTemplate(targetPage));_         }_      );__    directoryContainer.one('.directory-list').delegate(_            'click',_               function(event) {_                  event.preventDefault();__                   var currentPage = A.DataType.Number.parse(currentPageNode.html());__                    var currentTargetClass = event.currentTarget.getAttribute('class');__                   if ((currentTargetClass == 'delete-site') || (currentTargetClass == "leave-site") || (currentTargetClass == "join-site") || (currentTargetClass == "request-site")) {_                  var confirmMessage = '';__                              var siteAction = '';__                          var siteNode = event.currentTarget.ancestor('li');__                            var siteName = siteNode.one('.name a');__                               if (!siteName) {_                                       siteName = siteNode.one('.name');_                              }__                     var unescapedSiteName = Liferay.Util.unescapeHTML(siteName.getContent());__                             if (currentTargetClass == "leave-site") {_                                      confirmMessage = 'Êtes-vous sûr de vouloir quitter ' + unescapedSiteName + ' ?';_                                     siteAction = 'Vous avez quitté ' + unescapedSiteName + '.';_                           }_                      else if (currentTargetClass == "join-site") {_                                  confirmMessage = 'Êtes-vous sûr de vouloir rejoindre ' + unescapedSiteName + ' ?';_                           siteAction = 'Vous avez rejoint ' + unescapedSiteName + '.';_                           }_                              else if (currentTargetClass == "request-site") {_                               confirmMessage = 'Ce site est à accès restreint. Voulez-vous soumettre une demande d'adhésion à ' + unescapedSiteName + ' ?';_                                      siteAction = 'Votre demande d'adhésion a été envoyée.';_                            }_                              else {_                                 confirmMessage = 'Êtes-vous sûr de vouloir supprimer ' + unescapedSiteName + ' ?';_                                   siteAction = 'Vous avez supprimé ' + unescapedSiteName + '.';_                         }__                             if (confirm(confirmMessage)) {_                                 A.io.request(_                                          event.currentTarget.get('href'),_                                               {_                                              after: {_                                                               success: function(event, id, obj) {_                                                            siteName.insert(siteAction, 'replace');__                                                                       var updateSites = function() {_                                                                 Liferay.SO.Sites.updateSites(false, keywordsInput.get('value'), getRequestTemplate(currentPage));_                                                                      }__                                                             setTimeout(updateSites, 2000);__                                                                        _                                                       }_                                                      }_                                              }_                                      );_                             }_              }_                      else {_                         A.io.request(_                                  event.currentTarget.get('href'),_                                       {_                                      after: {_                                                       success: function(event, id, obj) {_                                                            Liferay.SO.Sites.updateSites(false, keywordsInput.get('value'), getRequestTemplate(currentPage));__                                                             _                                                       }_                                      }_                                      }_                              );_                     }_              },_             '.action a'_    );__    _})();});_// ]]>_ [Sanitized]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ken.duenwald Ken Duenwald
                Reporter:
                ken.duenwald Ken Duenwald
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 3 days ago

                  Packages

                  Version Package
                  3.X EE
                  3.X CE
                  3.1 EE
                  3.1.0 CE