| Steps to reproduce
- Go to user's profile page
- Click "Change photo" button
- Browse and select a first image
- Click "Upload and select" button
- Click "Change photo" button again
- Browse and select another (second) image
- Click "Upload and select" button
- Click "Change photo" button again
- Click "Select" (green check) button for the first uploaded image
Expected results The first image uploaded is set as avatar (may require a page refresh to be seen). Actual results The first image cannot be set as avatar at this point. A red error message is displayed on the bottom of the page:
Failed:Server not responding
In browser's JS console, the following errors are displayed:
prototype.js?r=1:1739 POST http:request @ prototype.js?r=1:1739
initialize @ prototype.js?r=1:1704
(anonymous) @ prototype.js?r=1:447
klass @ prototype.js?r=1:80
onSelect @ AttachmentSelector:227
(anonymous) @ prototype.js?r=1:417
(anonymous) @ prototype.js?r=1:7266
and
prototype.js?r=1:1837 Uncaught TypeError: Cannot read properties of undefined (reading 'match')
at klass.isSameOrigin (prototype.js?r=1:1837:22)
at klass.respondToReadyState (prototype.js?r=1:1819:43)
at klass.onStateChange (prototype.js?r=1:1754:12)
isSameOrigin @ prototype.js?r=1:1837
respondToReadyState @ prototype.js?r=1:1819
onStateChange @ prototype.js?r=1:1754
XMLHttpRequest.send
request @ prototype.js?r=1:1739
initialize @ prototype.js?r=1:1704
(anonymous) @ prototype.js?r=1:447
klass @ prototype.js?r=1:80
onSelect @ AttachmentSelector:227
(anonymous) @ prototype.js?r=1:417
(anonymous) @ prototype.js?r=1:7266
The issue also reproduces if the user goes back to change any other picture from existing ones. The issue couldn't be reproduced on XWiki 17.6.0. |