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

User cannot delete web content template if it is required in other portal instance

    Details

    • Fix Priority:
      3

      Description

      When user tries to delete a web content template it gets an error message in the UI saying that such template cannot be delete because they are referenced by web contents, even if there are no web contents at all in the portal instance.
      It alsos affects portal instance deletion, which, for the same reason, fails to complete and throws an exception (see attached stacktrace).
      The reason is that DDMTemplateLocalServiceImpl.deleteTemplate(DDMTemplate) calls JournalArticleUtil.countByTemplateId(template.getTemplateKey()). The latter does not take in account the companyid of the template and, thus, if there are any JournalArticle belonging to another company that references a template that has the same templatekey, the counting is non-zero and the exception is thrown.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cleydyr.albuquerque Cleydyr Albuquerque
              Reporter:
              cleydyr.albuquerque Cleydyr Albuquerque
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 14 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Alpha 1