-
Notifications
You must be signed in to change notification settings - Fork 641
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
Can't Create New Field Programmatically in Script #2999
Comments
Looks like you’re doing this in a custom entry script? You probably just need to add this to the bottom: $craft->end(); To fix your current install, just delete your |
@brandonkelly Awesome, thanks for the help. I did put in Is there a reason those classes in |
Those dynamically-generated ContentBehavior and ElementQueryBehavior classes are only regenerated when the I’m not sure why |
You guys rock, thanks Brandon! |
Description
Trying to add a few (plain text) fields in a basic one-off script... can't even get one to save.
The field allegedly saves correctly but when I then try to access another page (say the CP), the very next thing I get is a
"Setting unknown property: craft\behaviors\ContentBehavior::"
and then the field handle error.The row appears to be inserted in the fields table and fieldService isn't throwing an error but apparently something else isn't being saved.
Not sure it's my script or a Craft bug? (Basically boilerplate code from this gist.)
Stack Trace:
Additional info
The text was updated successfully, but these errors were encountered: