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

MinimalAssetEntryValidator is called twice if entity has at least one tag

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed

      Description

      liferay-portal-6.1.0-ce-ga1 with tomcat-7.0.23 and Hypersonic

      1. Use MinimalAssetEntryValidator as validation class in portal-ext.properties

      Input a class name that extends
      com.liferay.portlet.asset.util.BaseAssetEntryValidator. This class will be
      called to validate entries. The DefaultAssetEntryValidator class is just
      an empty class that doesn't actually do any validation. The
      MinimalAssetEntryValidator requires all entities to have at least one tag.
      #
      #asset.entry.validator=com.liferay.portlet.asset.util.DefaultAssetEntryValidator
      asset.entry.validator=com.liferay.portlet.asset.util.MinimalAssetEntryValidator

      2. Put Asset Publisher Portlet on Page
      3. Add New Basic Web Content or any other
      4. Fill out required fields
      5. Add at least one tag
      6. Save will throw error that at least one tag must be specified

      Debugging the code:
      The validate method is called twice when at least one tag is added to the asset. First call is ok and the tagNames String is valid, but in the second call the tagNames String is null and thus the validation fails.

      Additonal node:
      If no tag is added to the asset, the tagNames String is not null and empty throwing the Validation Exception as expected, also the method is only called once.

      I didn't get further why the method is called twice. Might also affect custom validation classes.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tammy.fong Tammy Fong (Inactive)
              Reporter:
              marc_musch Marc Musch
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 22 weeks, 2 days ago

                  Packages

                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2