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

java.lang.NumberFormatException in Asset Publisher when using localized fields in custom ADT

    Details

    • Fix Priority:
      5

      Description

      >> Steps to reproduce:
      1. Create a simple Web Content Structure with only a localizable text field.
      2. Create a simple Template for the previously created Structure.
      3. Create Web Content using this Structure
      4. Add a translation for the Web Content and publish
      5. Add a new Asset Publisher ADT (use the attached one, select Velocity as Language)
      6. Add an Asset Publisher Portlet to a page and use the previous ADT

      >> Result:

      You'll receive the following exception:

      ERROR [RuntimePageImpl-2][LocaleTransformerListener:205] null
      java.lang.NumberFormatException: null
      at java.lang.Long.parseLong(Long.java:404)
      at java.lang.Long.parseLong(Long.java:483)
      [...]

      >> More details:

      The problem appears on LocaleTransformerListener, when trying to do:

      Long.parseLong(tokens.get("article_group_id"));

      The problem is that inside the tokens has map does not exist an article_group_id key. This map was created in JournalArticleImpl.getContentByLocale(String languageId) method.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 40 weeks ago