Media revision shows as 'Anonymous' instead of current user when using 'Media Image Upload' widget.

Created on 30 May 2025, about 1 month ago

Problem/Motivation

When uploading an image using the Entity Browser with the "Upload images as media items" widget, the resulting media revision is incorrectly attributed to "Anonymous" instead of the currently logged-in user. This causes incorrect authorship data in the media revision history.

Steps to reproduce

  1. Install the following modules:
  2. Enable the Media module and at least one media type (e.g., Image).
  3. Create a new Entity Browser.
  4. In the Entity Browser configuration, add the "Upload images as media items" widget plugin.
  5. Create a new entity reference field (Reference type: Media, Media type: Image) on a content type (e.g., Article or Basic Page).
  6. Configure the field to use the created Entity Browser via Manage form display.
  7. Add or edit a content item of the selected content type.
  8. Upload an image using the Entity Browser field with the "Upload images as media items" widget.
  9. Save the content item.
  10. Go to Content/Media, view the associated media entity, and check its revision log.

Expected Result:

The media revision should show as authored by the current user (e.g., admin).

Actual Result:

The media revision shows as authored by "Anonymous (not verified)".

Proposed resolution

Update the media entity revision process when uploading image through the "Upload images as media items" widget in the Entity Browser to correctly assign the revision author as the authenticated user performing the upload, instead of defaulting to "Anonymous (not verified)". This may involve ensuring the current user context is properly passed and respected during the media entity save operation triggered by "Upload images as media items" within the Entity Browser widget.

🐛 Bug report
Status

Active

Version

2.13

Component

Widget plugins

Created by

🇮🇳India saiprasad_g

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024