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

getting field with the changed handle before CustomFieldBehavior knows about it #14233

Closed

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jan 29, 2024

Description

An error occurred when applying project config with a single section type and an entry type with a field whose handle has been renamed, and when saving a global with a field with a newly renamed handle.

This was caused by the field not yet loaded into the CustomFieldBehavior::$fieldHandles.

Related issues

#14166
#14221

@i-just i-just requested a review from brandonkelly January 29, 2024 10:42
brandonkelly added a commit that referenced this pull request Jan 29, 2024
@brandonkelly
Copy link
Member

Solved in a simpler way via e6d5133

(This is based on the same thing saveField() does for new field handles here:

cms/src/services/Fields.php

Lines 1240 to 1241 in e6d5133

// Tell the current CustomFieldBehavior class about the field
CustomFieldBehavior::$fieldHandles[$fieldRecord->handle] = true;

@brandonkelly brandonkelly deleted the bugfix/14166-element-field-by-handle-changed-handle-amends branch January 29, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants