New field default value #18489
-
|
If adding a new required button group field (for example) to an entry type and you set a default value, would it make sense to me to have that default value automatically apply to existing entries, probably on save? The example is I have an existing site to which I add a new required field. When I go to save that entry (or one that it's in/on/within – not sure of the terminology) I can't because the field is required and requires me to go into each entry to set the field. I'm sure there's a reason I'm not thinking of and this has problem been reasoned about already. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Updating all the existing entries with the default value could be a very expensive, long-running operation, so it’s not something Craft can easily do automatically. You can do it using the php craft resave/entries --section=mySection --set=myFieldHandle --to=theDefaultValue --if-empty |
Beta Was this translation helpful? Give feedback.
Updating all the existing entries with the default value could be a very expensive, long-running operation, so it’s not something Craft can easily do automatically. You can do it using the
resave/entriescommand, though: