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

Liferay Forms does not make a provision for StorageException in JSPs

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.2.0 GA1, 7.2.10 DXP GA1, 7.2.10 DXP FP1
    • Fix Version/s: None
    • Component/s: Forms
    • Labels:
      None

      Description

      Problem Background

      This problem stems from the fact that there is no provision for StorageException in the JSPs associated with Liferay Forms. For example, the JSPs do not contain something like the following:

      view.jsp
      <liferay-ui:error exception="<%= StorageException.class %>" message="an-unexpected-error-occurred" />
      

      Steps to Reproduce

      1. Create a new module with a CustomStorageAdapter that looks like this and deploy the module to $LIFERAY_HOME/osgi/modules:

      CustomStorageAdapter.java
      package com.mycompany;
      
      import com.liferay.dynamic.data.mapping.exception.StorageException;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapter;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterDeleteRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterDeleteResponse;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterGetRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterGetResponse;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterSaveRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterSaveResponse;
      import org.osgi.service.component.annotations.Component;
      
      @Component(
      	immediate = true, property = {"ddm.storage.adapter.type=Custom"},
      	service = DDMStorageAdapter.class
      )
      public class CustomStorageAdapter implements DDMStorageAdapter {
      
      	@Override
      	public DDMStorageAdapterSaveResponse save(
      		DDMStorageAdapterSaveRequest ddmStorageAdapterSaveRequest)
      		throws StorageException {
      
      		throw new StorageException("some type of storage error");
      	}
      
      	@Override
      	public DDMStorageAdapterDeleteResponse delete(
      		DDMStorageAdapterDeleteRequest ddmStorageAdapterDeleteRequest)
      		throws StorageException {
      		return null;
      	}
      
      	@Override
      	public DDMStorageAdapterGetResponse get(
      		DDMStorageAdapterGetRequest ddmStorageAdapterGetRequest)
      		throws StorageException {
      		return null;
      	}
      }
      

      2. Click on "Content & Data -> Forms" in the Control Panel and create a form with a single text field.

      3. Before hitting the Save button, click the "..." button at the top of the page and then click on "Settings".

      4. Select "Custom" from the dropdown list for the custom storage option.

      5. Disable the autosave.

      6. Set the name of the form to be "MyForm"

      7. Save the form.

      8. Publish the form.

      9. Add the Forms portlet to a portal page and select "MyForm" to be displayed.

      10. Fill out the form and click on Save

      Expected Results

      The user should be alerted to some type of backend error due to the StorageException being thrown.

      Actual Results

      The user is not alerted.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neil.griffin Neil Griffin
              Participants of an Issue:
              Recent user:
              Neil Griffin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                10 weeks ago

                Packages

                Version Package