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

Users should be warned if they delete a template that is not in use in any WC, but is used in a Display Page Template

    Details

      Description

      Description
      Currently if you delete a WC template in use by a Display Page Template, but not used by a WC, the Display Page Template will just unmap the template field if it was previously set, but this could be dangerous if a user accidently deletes a template that is used in many different display page because they thought it was not used by any wc. We should warn the user when deleting it at the minimum, possibly even deny the user.

      Steps to Reproduce

      1. Create a custom struct
      2. Create a custom template based off the struct
      3. Create a second "dummy template" based off the struct
      4. Add an editable fragment to a display page
      5. Set mapping of display page to use the custom structure
      6. Map an editable field to the custom template
      7. Publish display page
      8. Create WC using dummy template, but set the display page to the published display page
      9. Preview WC, and assert it properly displays the display page + template rendering
      10. Delete template

      Expected Result
      Template deletion warned or denied, since it is in use by a display page template

      Actual Result
      Template deleted

      Tested on Tomcat 9.0.17 + MySQL 5.7
      Portal master GIT ID: cd778159969289540f3e8a2793c83b2824f00ef2

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kyle.miho Kyle Miho
                Reporter:
                kyle.miho Kyle Miho
                Participants of an Issue:
                Recent user:
                Kyle Miho
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 weeks, 5 days ago