Closed (won't fix)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.0-rc8
Component:
General
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2008 at 10:21 UTC
Updated:
10 Nov 2010 at 21:20 UTC
I've noticed that when you create a field with a default value, the value does't appear in the edit form for nodes created before the creation of the field (like in the form for creating a new node).
Is this a bug or a feature? :) I mean is this the desired behavior?
Comments
Comment #1
karens commentedThis is the way CCK has always behaved, in all earlier versions as well as the current version. It doesn't seem safe to make assumptions about what value should be supplied for existing data and stored in the database. The default value is just a 'suggestion' that is presented to the user at a time when they can change it if it's not the right answer, it's not necessarily the right value for all those pre-existing nodes.
For now we assume that if you add new fields to content types that already have data, it is either something that can be left empty or you will take care of entering the right value into those nodes yourself.
Comment #2
ambrojio commentedAn old topic, I realize, but I kind of disagree with the notion that you can't make assumptions about the desired content of the field in existing nodes. Since it's a brand new field, then obviously that data has not been addressed in existing nodes, and setting it to a default value seems reasonable.
Comment #3
sedmi commentedIt would be good to have a choice when entering default value, something like:
Update existing nodes? yes/no
Comment #4
karens commentedAll this functionality has already been ported to core for D7 and there is no such option there. There would not be much benefit to adding a new feature like this late in the D6 cycle for something you can't do in D7.
CCK doesn't have to handle this. This is something that someone who has an itch could put into a contrib module and find a way to get it working in both D6 and D7 so that it has a future.