Charpentier Lucas Reopening for now since it breaks the CI with failing tests in XARImportIT.
Analysis:
## Why XARImportIT is failing in master #8682
**It's a real product regression, not a test problem.** The XAR-import-via-UI flow is broken.
### What's failing
7 of the 9 `XARImportIT` methods fail, all with **age 6 → first failure at build #8677**. The stack trace (e.g. `testImportAsBackup`):
```
org.openqa.selenium.NoSuchElementException: Unable to locate element: Main.TestPage-backup.xar
at ImportAdministrationSectionPage.selectPackage(ImportAdministrationSectionPage.java:100)
at XARImportIT.testImportAsBackup(XARImportIT.java:242)
```
After the test attaches a XAR, the package link never appears in `#packagelistcontainer`, so `selectPackage` can't click it.
**Why exactly 7 of 9:** the 7 failures all go through the browser form-upload path `attachPackage()` → `selectPackage()`. The 2 that pass avoid it — `testImportHasNoPackageByDefault` never uploads, and `testXSSInPackageExplorer` uploads via the **REST API** then reloads, bypassing the broken widget.
### Root cause
Build #8677's changes contain exactly one commit touching the attachment-upload stack:
**`c0b36b6` — XWIKI-22125 "The UI should be clearer about finished attachment uploads" (PR #5001).** It rewrote `uicomponents/widgets/upload.js` (~589 lines, Prototype.js → ES6 classes). The import page depends on this widget's auto-upload behavior:
1. `ImportAdministrationSectionPage.attachPackage()` only does `sendKeys(file)` to `#xwikiuploadfile` (line 80) — no upload click; it relies on the widget's `autoUpload: true`.
2. `importinline.vm` loads `upload.js` + `import.js`.
3. `import.js:89` wires `form.observe("xwiki:html5upload:done", hookRichImporterUI)`, which AJAX-refreshes `#packagelistcontainer`.
The rewrite still *defines* `autoUpload`/`onFilesSelected` and still fires `xwiki:html5upload:done` (unchanged context lines in the patch), so the break is a **runtime failure inside the rewritten widget** (mixed `document.createElement`/`classList`/`innerHTML` with Prototype `.fire/.update/.observe`; `onFilesSelected` swallows errors into an error message). The upload never completes → list never repopulates → `selectPackage` throws. The template edits in the commit are cosmetic for import (`upload.css` 2nd-arg removal); the `noitems` removal was on the *attachments* tab, not the import template.
### Recommendation
The fix belongs in **`upload.js`** (XWIKI-22125's owner), not the test:
1. Reproduce in a browser (Admin → Import, drop a `.xar`, watch the JS console for the auto-upload error) and fix the ES6/Prototype interop, **or**
2. Revert `c0b36b6` to unblock CI and re-land with import coverage.
3. Check whether a JIRA already exists — the import flow has been broken since 6/18.
Michael Hamann on 24/Jun/26 09:32
The UI in the admin with the upload button also looks quite weird:
Clicking on the upload button works, though.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.