Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neo field changed to Asset when edited in quick field #21

Open
nstCactus opened this issue Oct 11, 2023 · 1 comment
Open

Neo field changed to Asset when edited in quick field #21

nstCactus opened this issue Oct 11, 2023 · 1 comment
Labels

Comments

@nstCactus
Copy link

Bug Description

After editing a Neo field in quick-field from an entry type field layout, I noticed the field has changed to an Asset field.

While creating this ticket, I think I found the root cause of the issue: when the quick field modal window opens, the Field type dropdown isn't properly initialised and thus takes the value of the first <option>. If the user isn't extra careful when editing the field, he will overwrite the field type when saving.

Steps to reproduce

  1. Using Craft UI, create a Neo field, named "Main" (handle: contentBuildersMain)
  2. Go to an entry type and add the Neo field to it
  3. Save the entry type
  4. Edit the entry type again and edit the Neo field using quick field
  5. Set the name of the Neo field to "Content blocks"
  6. Save the Neo field
  7. Using Craft UI, edit the Neo field and notice its type has changed to Asset

Expected behaviour

The type of the Neo field should be kept when editing a field in quick field.

When the quick-field modal window opens, the Field type dropdown should be properly initialised with the current field type.

Quick Field version

2.0.5

Craft CMS version

4.5.6.1

@nstCactus nstCactus added the bug label Oct 11, 2023
@ttempleton
Copy link
Collaborator

Neo is intentionally filtered out of the available field types. I can't say for sure what the original reasoning was, since that was well before my time working on the plugin - but my guess would be that by allowing editing of Neo fields, which themselves load full field layout designers, you allow infinite Quick Field modals to be opened.

A potential solution is to allow Neo fields to be edited, but disallow Quick Field from initialising when the Neo field edit page is inside a modal. I'll need to look into that when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants