Uploaded image for project: 'Share Application'
  1. Share Application
  2. SHA-1743

itemJSON produces invalide JSON when item.likes is not set

    Details

    • Bug Priority:
      Category 1
    • Work Funnel:
      Maintenance
    • Story Points:
      3

      Description

      This issues is related to Alfresco Share Services.

      itemJSON macro is defined in file templates/webscripts/org.alfresco/slingshot/documentlibrary-v2/item.lib.ftl

      The part relative to "likes" processing is:
      {{<#if item.likes??>"likes":
      {
      "isLiked": ${item.likes.isLiked?string},
      "totalLikes": ${item.likes.totalLikes?c}
      }</#if>,}}

      When item.likes doesn't exists, the JSON likes section isn't produced in output, but the comma is written.

      To correct this use:
      {{<#if item.likes??>"likes":
      {
      "isLiked": ${item.likes.isLiked?string},
      "totalLikes": ${item.likes.totalLikes?c}
      },</#if>}}

        Attachments

          Structure

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cleseach Charles Le Seac'h
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Structure Helper Panel