Image don't upload correctly when i'm not in admin BO

Created on 19 July 2023, 11 months ago

Problem/Motivation

Steps to reproduce

I'create a custom entity with image field and i use "File uploader by Uppy" widget to upload all of my image it work correctly in Back office (administrator) but don't work in other BO with other role. This is the screenshot of the error (Error of the selector in js).

Proposed resolution

My solution is to change the setting.name in Php

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡²πŸ‡¬Madagascar Dev-man

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

Comments & Activities

  • Issue created by @Dev-man
  • πŸ‡²πŸ‡¬Madagascar Dev-man
  • πŸ‡ΊπŸ‡ΈUnited States robphillips

    Managed to replicate the issue by creating an image field inside a paragraph type and attaching the paragraph as a field on a node type. Doesn't seem to be related to roles/permissions. Rather whether or not the image field is nested (tree).

    Patch works fine. I couldn't recall why implode('_', $element['#parents']) was used in the first place. Possibly to ensure each element name is totally unique, but that should always be the case because field names must be unique. Element name should be fully formed by the time the process hook is invoked. So I can't think of a reason not to use $element['#name'] here.

    Verified both non-nested and nested fields work as expected with patch. Committed.

    • Dim-dev β†’ authored b92834e0 on main
      Issue #3375427 by Dim-dev: Fixes element name passed to file uploader...
  • πŸ‡²πŸ‡¬Madagascar Dev-man

    Thanks

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024