This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-f49cb8d4-277e-4595-9118-279bbe37811b XWIKI-23842 Open

permanentlyDelete and restore batch APIs from services.refactoring don't work

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-d9d2c5a8-a1fc-452f-a70f-c6ed3aee2c81 Anca Luca created this issue on 22/Dec/25 17:44
 
Summary: permanentlyDelete and restore batch APIs from services.refactoring don't work
Issue Type: cid:jira-generated-image-avatar-f49cb8d4-277e-4595-9118-279bbe37811b Bug
Affects Versions: 10.11.9, 16.10.11
Assignee: Unassigned
Components: Refactoring
Created: 22/Dec/25 17:44
Priority: cid:jira-generated-image-static-major-4742a8a2-4ec8-4d17-9d98-d1ec27c58ba0 Major
Reporter: Anca Luca
Description:

This issue concerns the permanentlyDelete and restore functions of the services.refactoring API that take a batch as a parameter, introduced by XWIKI-15787, and documented in https://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring%20Module#HRestoreabatchofdeleteddocuments28since29 .

How to reproduce:

  • create a page
  • delete this page
  • from the recycle bin or in the view screen of the deleted page, copy the batch id that corresponds to this page deletion
  • in a page, attempt the permanently delete using the following piece of script (in a groovy script):
    {{groovy}}
    def batchid = "<fill in the copied batch id here>"
    services.refactoring.permanentlyDelete(batchid).join()
    {{/groovy}}
    
  • in another page (or the same), attempt the restore of the batch using the following piece of script (in a groovy script):
    {{groovy}}
    def batchid = "<fill in the copied batch id here>"
    services.refactoring.restore(batchid).join()
    {{/groovy}}
    

Expected result:

  • depending on the used script, the batch is permanently deleted or restored

Actual result:

  • there is no impact on the pages in the recycle bin (nor permanent deletion nor restore)
  • in the logs of the permanentlyDelete or restore jobs (if fetched from the job logs), the following message appears:
The author [null] of this script is not allowed to permanently deleted document [xwiki:Sandbox.Test page to delete()] with id
The author [null] of this script is not allowed to restore document [xwiki:Sandbox.Test page to delete()] with ID [28]