Skip to content

[5.x]: Unable to change field handle for a global field #16963

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

Open
joshwalsh opened this issue Mar 26, 2025 · 3 comments
Open

[5.x]: Unable to change field handle for a global field #16963

joshwalsh opened this issue Mar 26, 2025 · 3 comments
Labels

Comments

@joshwalsh
Copy link

What happened?

Description

When I add an existing field to a global, I am unable to change the fieldHandle.

Steps to reproduce

  1. Take an existing field, in my case is an asset field, and drag it into the field layout within a globals section.
  2. Save that globals section, successfully.
  3. Click the "..." next to that asset field and give it a new contentHandle. (It doesn't matter what you change it to)
  4. Click "Apply"... looks successful
  5. Click Save on the global page.
  6. Met with InvalidFieldException

Image

Expected behavior

This should give the instance of the field the desired name, as it does correctly in Entry Types.

Actual behavior

Throws above exception.

Craft CMS version

5.6.12

PHP version

8.2.18

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@joshwalsh joshwalsh added the bug label Mar 26, 2025
@i-just
Copy link
Contributor

i-just commented Mar 27, 2025

Hi, thanks for reaching out!

Could you please confirm a few things?

  • When you say “the field layout within a globals section”, do you mean Control Panel > Settings > Globals > ?
  • Are you trying to change the field’s handle or name?
  • Assuming you’re trying to change the handle, what’s the current value, and what are you changing it to? (if it’s the name you’re changing, then could you share the name values)
  • Please share the list of installed plugins and versions as well as the database driver and version

@joshwalsh
Copy link
Author

When you say “the field layout within a globals section”, do you mean Control Panel > Settings > Globals > ?

Yes.

Are you trying to change the field’s handle or name?

Handle:

Image

Assuming you’re trying to change the handle, what’s the current value, and what are you changing it to? (if it’s the name you’re changing, then could you share the name values)

From "contentImage" to "badgeImage".

Please share the list of installed plugins and versions as well as the database driver and version

Plugins:

  • CKeditor
  • Contact Form
  • Contact Form Extensions
  • Feed Me
  • SEO
  • SendGrid
  • Vite

Database driver & version: MySQL 8.0.33

@brandonkelly
Copy link
Member

Not able to reproduce that on my end. Any chance you can send your database backup and Composer files into [email protected] so we can test with your site?

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

3 participants