| Steps to reproduce
- Add an attachment to a page
- Go to 'Attachments' tab, click on 'Move' from the 'Actions' column
- Choose a new page under 'New Attachment Location'
- Click 'Submit' button
- Click on 'Job log' to expand and observe the move logs
Expected results No warnings are displayed (related to abusive modifications). Actual results The following warning is displayed twice:
Abusive modification of the cached document
class java.lang.IllegalStateException: Abusive modification of the cached document
at com.xpn.xwiki.doc.XWikiDocument.warnWithStackTrace(XWikiDocument.java:9416)
at com.xpn.xwiki.doc.XWikiDocument.setMetaDataDirty(XWikiDocument.java:2459)
at com.xpn.xwiki.internal.doc.XWikiAttachmentList.updateList(XWikiAttachmentList.java:263)
at com.xpn.xwiki.internal.doc.XWikiAttachmentList.remove(XWikiAttachmentList.java:158)
at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5692)
at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5678)
at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.moveAttachment(MoveAttachmentJob.java:162)
at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.process(MoveAttachmentJob.java:112)
at org.xwiki.refactoring.internal.job.AbstractEntityJob.process(AbstractEntityJob.java:225)
at org.xwiki.refactoring.internal.job.AbstractEntityJob.runInternal(AbstractEntityJob.java:202)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
No warnings on the XWiki console. The issue could be also reproduced on XWiki 17.10.9 and 18.6.0-SNAPSHOT. |