0

I have and existing channel with existing entries. I added a new custom field, a radio button group, with options YES/NO, with the default option being YES.

The field is now available in the edit entry form but it has no value set until I click an option (YES) and then save the form.

Is there a way to set/publish the default value for all existing entries?

1

You'll have to run a query on the database to set the past entries' values for this new field:

UPDATE exp_channel_data SET field_id_XX = 'YES' WHERE field_id_XX == '' AND channel_id = X;

Just replace XX with the correct field_id and X with the correct channel_id.

And, as with anytime you run a write query on the database, back it up first!

| improve this answer | |
  • I had to change the double '==' to a single '=' and then it worked. – Louis K Nov 12 '15 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.