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

EditContentByCopyFunction leads to some errors on content observers

XMLWordPrintable

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

      The EditContentByCopyFunction fires a CONTENT_MODIFIED event but with bad argument :
      content.id argument receive the Content object instead of its id.

      Some observers could fail with a ClassCastException

      Category:	org.ametys.plugins.userdirectory.observation.SolrContentModifiedObserver
      Message:		Unable to observe event: event[id: content.modified, issuer: UserIdentity [login=admin, population=ametys_demo_users], args: [content.id = '/ametys-internal:sites/www/ametys-internal:contents/remontee-de-contenu-article' (defaultWebContent://6acb1aef-738e-44b5-9553-7f5b5577755a), content = '/ametys-internal:sites/www/ametys-internal:contents/remontee-de-contenu-article' (defaultWebContent://6acb1aef-738e-44b5-9553-7f5b5577755a)]]
      Location:	org.ametys.plugins.userdirectory.observation.AbstractContentObserver.observe(AbstractContentObserver.java:130)
      Thrown:
      java.lang.ClassCastException: class org.ametys.web.repository.content.jcr.ModifiableDefaultWebContent cannot be cast to class java.lang.String (org.ametys.web.repository.content.jcr.ModifiableDefaultWebContent is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @560513ce; java.lang.String is in module java.base of loader 'bootstrap')
      	at org.ametys.plugins.userdirectory.observation.AbstractSolrContentAsyncObserver._getTarget(AbstractSolrContentAsyncObserver.java:31)
      	at org.ametys.plugins.userdirectory.observation.AbstractContentObserver.observe(AbstractContentObserver.java:94)
      	at org.ametys.core.observation.ObservationManager$ParallelAsyncObserve._observe(ObservationManager.java:502)
      	at org.ametys.core.observation.ObservationManager$AbstractAsyncObserve.call(ObservationManager.java:448)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

            laurence Laurence Aumeunier
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: