Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
7.x-2.x-dev
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2010 at 17:58 UTC
Updated:
19 Jun 2012 at 15:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
copyhold commentedSame error when setting default value function to any field type.
Also default_value_function value not saved.
Comment #2
tobiasbComment #3
neopoet commentedThanks -- this solves my problem as well.
Comment #4
droplet commentedthe patch working well.
Comment #5
jzornig commentedThe patch didn't apply neatly on the current dev version, but after applying it manually it works for me.
Comment #6
droplet commentedComment #7
derjochenmeyer commentedPatch does not apply and can't be applied manually to current dev
Comment #8
das-peter commented@tobiasb Thanks for the patch :)
I've rerolled it against latest HEAD. Should work again.
Comment #9
MrPhilbert commentedSame issue here. The above file is a diff file? I've use patch files but not a diff file. Will this be added to dev?
Comment #10
das-peter commented@MrPhilbert: You should be able to use the .diff file as patch - it's just a file naming "issue".
Comment #11
rfaysubscribe
Comment #12
yched commentedIncorrect. The value lies in $instance['settings']['default_value_function'], and Field API normally takes care of always populating the entry.
$form['#field'] should also always be present.
If it's not, something is seriously wrong and should be fixed upstream, we don't want to hide that under the carpet and pretend it didn't happen.
More generally, we do not sprinkle code with random isset's all over the place.
I'm won't fixing this as is stands now. If there are actual reported warnings, with line numbers and steps to reproduce, let's investigate them one by one in dedicated issues..
Powered by Dreditor.
Comment #13
yched commentedAs per #12
Comment #14
rfayI think this is in fact a single issue that has to be resolved, so I'm going to reopen with your permission.
How to recreate: Visit any edit or form settings form for a select-type field, configure, and submit. There is a set of problems: Some field values are not saved (as can be viewed in the cck_field_settings table). And some accessed array indexes do not exist, for related reasons, resulting in the OP report.
Many of the problems here are because these forms are injected on both the edit (instance) and the field settings tabs/forms.
$form['#field'] and $form['#instance'] are set on the "edit" (instance) tab, but they are not set on the field settings tab.
I'm close to a patch for your review, but don't want to lose this information.
Comment #15
yched commentedThat code needed some love :-). Warnings indeed, plus didn't actually work.
Committed the attached patch, which should fix the issues.
Comment #16
rfayThanks so much. I actually worked on it quite a bit on the plane, but didn't get far enough to post :-) It's downright hard to get your head into that stuff. Glad your head's in it.
Comment #17
yched commentedWell, FWIW, now that we have a clearer view on what's left in the CCK project in D7 (that is : the migration code...), I'd say the code that currently lies in cck.module (providing the 'php default value' / 'php allowed values' that didn't make it in core) would be better off in a separate project, field_php_values or something.
Comment #18
rfayI gave this a test spin and it seems fine to me. Thanks for doing this!
Comment #19
karens commentedYep, if anyone would like to take over that code, it's all yours :) Initially there were a number of things that didn't make it into core that needed to be handled, but we're down to just that one thing, so it really does make more sense to move it out into its own project.
Comment #21
kenorb commentedRelated: #1003976: Option to populate select list with php lost in change from cck to fields