Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13916

BaseClass#addTextAreaField try to modify existing field without checking if it's already the right type

    Details

    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Regression caused by XWIKI-13647. Before that addTextAreaField was not doing anything if the field already existed.

      Getting for example:

      2016-12-01 12:51:47,688 [pool-1-thread-1] ERROR c.x.x.i.WikiInitializerJob     - Exception thrown during job execution 
      java.lang.ClassCastException: com.xpn.xwiki.objects.classes.StringClass cannot be cast to com.xpn.xwiki.objects.classes.TextAreaClass
      	at com.xpn.xwiki.objects.classes.BaseClass.addTextAreaField(BaseClass.java:890)
      	at com.xpn.xwiki.objects.classes.BaseClass.addTextAreaField(BaseClass.java:878)
      	at com.xpn.xwiki.objects.classes.BaseClass.addTextAreaField(BaseClass.java:868)
      	at com.xpn.xwiki.internal.mandatory.XWikiPreferencesDocumentInitializer.updateDocument(XWikiPreferencesDocumentInitializer.java:200)
      	at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1271)
      	at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1243)
      	at com.xpn.xwiki.internal.WikiInitializerJob.runInternal(WikiInitializerJob.java:108)
      	at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
      	at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      It should replace the field if it's not the right type.

        Attachments

          Activity

            People

            • Assignee:
              tmortagne Thomas Mortagne
              Reporter:
              tmortagne Thomas Mortagne
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: