Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-10660

Script Delete Content failed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.3.11, 4.4.0
    • None
    • None
    • None
    • 4.4 RC1
    • 4.4 RC1

      This script 

      count = 0
       Repository.query("//element(*, ametys:defaultContent)[ametys-internal:contentType='org.ametys.test.Content.exhaustif']").forEach(function(content) {
       Content.delete(content, {force:true})
       count++
       });
       session.save()
       print(count)

      fails with error

      class org.ametys.web.repository.content.jcr.ModifiableDefaultWebContent cannot be cast to class org.ametys.cms.repository.ModifiableDefaultContent (org.ametys.web.repository.content.jcr.ModifiableDefaultWebContent and org.ametys.cms.repository.ModifiableDefaultContent are in unnamed module of loader

            Unassigned Unassigned
            mfranchet Magali Franchet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: