craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.2k stars 617 forks source link

[5.x]: Unable to Add the Same Image Field Multiple Times #15246

Closed droemmelbert closed 1 week ago

droemmelbert commented 1 week ago

What happened?

Description

When defining an entry type, I can repeat certain fields (e.g., plain text, CKEditor) multiple times without issue. However, when attempting to add the same image field more than once, it disappears from the field list after being added once.

Screenshot 2024-06-25 at 14 33 04

Steps to reproduce

  1. Create an asset field, that only accpets images
  2. Create a new entry type
  3. try to add the asset/image field to the entry type multiple times

Expected behavior

I should be able to add the same image field to an entry type multiple times, similar to how plain text fields behave. This should also be possible for every other field aswell!

Actual behavior

Currently, I can add the image field only once to an entry type, despite attempting to add it multiple times.

Craft CMS version

5.2.0

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

i-just commented 1 week ago

Hi, thanks for reaching out! This is expected behaviour. Only fields that store content in the content table are reusable within a field layout. You can find more info about it here: https://github.com/craftcms/cms/issues/14237.

droemmelbert commented 1 week ago

@i-just Thanks for clarifying. I still think this would be a really helpful add-on/feature to include in a future upgrade!!! And seeing this has come up before, I think people are with me on this.

i-just commented 1 week ago

Not a problem. There’s already a discussion about it: https://github.com/craftcms/cms/discussions/14728, so you can follow along there.

Also, further clarification on why those fields are not multi-instance: https://github.com/craftcms/cms/discussions/8497#discussioncomment-9470293