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

Errors when setting a previously uploaded image as avatar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Blocker
    • 17.9.0-rc-1
    • 17.7.0
    • Icon Themes
    • Windows 11 Pro, Chrome 140, using an instance of XWiki 17.7.0 on PostgreSQL 17, Tomcat 11.0.11
    • Unknown

    Description

      Steps to reproduce

      1. Go to user's profile page
      2. Click "Change photo" button
      3. Browse and select a first image
      4. Click "Upload and select" button
      5. Click "Change photo" button again
      6. Browse and select another (second) image
      7. Click "Upload and select" button
      8. Click "Change photo" button again
      9. 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://localhost:1115/xwiki/bin/view/XWiki/undefined 404 (Not Found)
      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.

      Attachments

        Issue Links

          Activity

            People

              Lucas C Charpentier Lucas
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: