Let me start from the beginning in case others need help on this as well. I was reviewing the detailed description you provided on list fields here: http://www.gravityhelp.com/forums/topic/list-field-help.
I have a 4 column list with the following column labels:
Column 1: Amount
Column 2: Measurement
Column 3: Ingredient
Column 4: Notes
I'm using the Gravity Forms + Custom Post Types plugin. The form is being saved to a custom post type in Pending status and this list field is saving to a custom field called ingredient.
Based on what you explained previously about list fields and how they are saved, I was expecting something like the following in the database for the ingredient field:
a:5:{i:0;a:4:{s:6:"amount";s:2:"12";s:11:"measurement";s:6:"Ounces";s:10:"ingredient";s:13:"Candy Coating";s:5:"notes";s:5:"White";}i:1;a:4:{s:6:"amount";s:1:"6";s:11:"measurement";s:9:"Teaspoons";s:10:"ingredient";s:10:"Shortening";s:5:"notes";s:0:"";}i:2;a:4:{s:6:"amount";s:3:"1/4";s:11:"measurement";s:8:"Teaspoon";s:10:"ingredient";s:13:"Food Coloring";s:5:"notes";s:5:"Green";}i:3;a:4:{s:6:"amount";s:1:"4";s:11:"measurement";s:0:"";s:10:"ingredient";s:12:"Oreo Cookies";s:5:"notes";s:4:"Mint";}i:4;a:4:{s:6:"amount";s:1:"2";s:11:"measurement";s:8:"Packages";s:10:"ingredient";s:13:"Andes Candies";s:5:"notes";s:24:"4.67 ounces each package";}}
Instead, what I'm seeing in the database is:
12|Ounces|Candy Coating|White
6|Teaspoons|Shortening
etc...
It's not saving the list field with key/value pairs as one row in the database. Instead it's just saving the values and creating a row for each ingredient. [Just an fyi in case it matters, since I'm filing to a custom post type I don't need the form entry it creates, so I am using a function you provided in another forum post to delete the form entry upon submission.]
So when I go to review the custom post type entry, it's not displaying the ingredient field data that was submitted because it's looking for:
ingredient[i][amount]
ingredient[i][measurement]
ingredient[i][ingredient]
ingredient[i][notes]
Does that help?
Posted 13 years ago on Tuesday January 10, 2012 |
Permalink