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

StorageFieldRequiredException during article import, if the article contains a required date field

    Details

      Description

      Steps to reproduce:

      1. Create a structure with a required date field
      2. Create an article for that structure (with an arbitrary date for the field).
      3. Export into a LAR file.
      4. Import the LAR file into another portal.

      Expected behaviour:
      The article is imported.

      Current behaviour:
      The import fails.

      The log contains:

      com.liferay.portlet.dynamicdatamapping.StorageFieldRequiredException
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.validateDDMStructureFields(JournalArticleLocalServiceImpl.java:6747)
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.validate(JournalArticleLocalServiceImpl.java:6598)
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.validate(JournalArticleLocalServiceImpl.java:6695)
      	at de.init.zitbb.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.addArticle(JournalArticleLocalServiceImpl.java:202)
      

      This is a really unspecific error message and I opened an extra request for that: LPS-53541.

      The problem was introduced in 6.2.2 and is the result of an modification to DDMImpl:

      protected List<Serializable> getFieldValues(
      	DDMStructure ddmStructure, String fieldName, String fieldNamespace,
      	ServiceContext serviceContext)
      	throws PortalException, SystemException {
      	...
      	String fieldValueDateString = GetterUtil.getString(
      		serviceContext.getAttribute(fieldNameValue));
      
      	if (Validator.isNull(fieldValueDateString)) {
      		// It should be fieldValue = null;
      		fieldValue = StringPool.BLANK;
      	}
      	...
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tibor.jandi Tibor Jandi
              Reporter:
              starrunner Tobias Liefke
              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:
                6 years, 39 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 M6