I have added a column "classid" to the entry db, and the following to config.inc.php:
$select_options['entry.classid'] = array( 'C1'=>'STICKS + STRING: LEARN TO KNIT',
'C2' => 'REVERSIBLE JEKYLL BAG - WORKSHOP',
'C3' =>'THE DIGITAL DARKROOM - EDITING DIGITAL IMAGES WORKSHOP');
$select_options['repeat.classid'] = array( 'C1'=>'STICKS + STRING: LEARN TO KNIT',
'C2' => 'REVERSIBLE JEKYLL BAG - WORKSHOP',
'C3' =>'THE DIGITAL DARKROOM - EDITING DIGITAL IMAGES WORKSHOP');
When I edit an entry, the list of options appears, but the classid field always contains "0" regardless of what is selected.
I can't reproduce this. Which version of MRBS are you using? And what is the type of your field in the database (eg INT, VARCHAR(255), etc.)?
Campbell
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Bugs"
Version 1.4.10. Yes, I see that the datatype can be an issue. Initially I used ints as keys, so I used ints in the database. I'll change the DB column to a varchar and try again. Thanks. And HUGE kudos from my users, they really love this system.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Bugs"
OK, changing the field type to varchar 32 gets the selected VALUE stored in the DB. I was expecting the KEY to be stored (C1, C2, C3, etc.) so I could use it in a lookup on another table. What am I missing?
I can't reproduce this on either 1.4.10 or 1.4.11 (BTW, I recommend upgrading to 1.4.11 anyway, though it won't solve this problem).
However there is a problem if you are using integers as your keys, eg
See the documentation in systemdefaults.inc.php for an explanation:
So if you are able to use 'C1' instead of '1' then you'll avoid that problem. However if you do need to use integers as your key then you can but you'll have to edit MRBS a little. Briefly you'll need to modify the function create_field_entry_custom_field() in edit_entry.php so that it takes special action for your field. Just before the generate_input() add the following:
(It may be that you have to be on 1.4.11 for this to work)
Also note that you don't need to set $select_options['repeat.classid'] in the config file. Setting $select_options['entry.classid'] is sufficient.
If you're still getting problems with the C1 etc. keys then I suggest you upgrade to 1.4.11 and see if it still happens there and if so I'll need to investigate further.
Campbell
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Bugs"
That did the job. Thanks. Mahlon Stacy on behalf of Jekyll Island Arts Association. [email address snipped]
Last edit: Campbell Morrison 2014-08-08