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

Sax of a content value should not fail when the content does not exist

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.3.0
    • 4.3.0
    • None
    • None
    • 4.3 M5

      I have a view (courseList) that contains an attribute of type "content" (courseParts)

      <cms:metadata-set name="courseList" type="view" internal="true">
              <cms:metadata-ref name="ects" />
              <cms:metadata-ref name="nbHours" />
              <cms:metadata-ref name="courseParts" />
       </cms:metadata-set>
      
      

      This view is saxed in a ContentGenerator using the content.dataToSax method

      But the content value corresponds to a non-existing content in Live workspace.
      The rendering of the main content failed on front with the following error

      org.ametys.plugins.repository.UnknownAmetysObjectException: There's no node for id coursePartContent://7c86890d-4e4e-4363-a30c-0b5f177a54ac
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getNode(SimpleAmetysObjectFactory.java:187)
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getAmetysObjectById(SimpleAmetysObjectFactory.java:137)
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getAmetysObjectById(SimpleAmetysObjectFactory.java:1)
      	at org.ametys.plugins.repository.AmetysObjectResolver.resolveById(AmetysObjectResolver.java:352)
      	at org.ametys.cms.data.ContentValue.getContent(ContentValue.java:99)
      	at org.ametys.cms.data.type.AbstractContentElementType.valueToSAX(AbstractContentElementType.java:111)
      	at org.ametys.plugins.repository.data.holder.impl.DataHolderHelper.dataToSAX(DataHolderHelper.java:178)
      	at org.ametys.plugins.repository.data.holder.ModelAwareDataHolder.dataToSAX(ModelAwareDataHolder.java:199)
      	at org.ametys.plugins.repository.data.holder.ModelAwareDataHolder.dataToSAX(ModelAwareDataHolder.java:185)
      	at org.ametys.odf.program.generators.ProgramContentGenerator.saxCourse(ProgramContentGenerator.java:462)
      	at org.ametys.odf.program.generators.ProgramContentGenerator.saxCourseList(ProgramContentGenerator.java:412)
      	at org.ametys.odf.program.generators.ProgramContentGenerator.saxContainer(ProgramContentGenerator.java:324)
      	at org.ametys.odf.program.generators.ProgramContentGenerator.saxContainer(ProgramContentGenerator.java:320)
      	at org.ametys.odf.program.generators.ProgramContentGenerator.saxChildProgramPart(ProgramContentGenerator.java:161)
      	at org.ametys.odf.program.generators.ProgramContentGenerator._saxOtherData(ProgramContentGenerator.java:101)
      

      The AbstractContentElementType.valueToSAX should handle this case.

            raphael Raphaƫl Franchet
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: