If this has already been requested for 6.x or 7.x, I'm sorry, add me as a +1... I would like to point out though that this has been requested for Drupal 4 as well as Drupal 5 and both requests have been closed without a resolution... I think mainly because the requests are being filed at the dying end of the past Drupal releases which is why I'm hoping this gets some attention for D7... (I would really love to see it be implemented for 6... but I know everyone's busy gearing up for 7...)

Basically, what I have wished for quite some time, is the ability to have the "default value" for a cck field, (or the introduction of a new cck field) update all existing or old nodes of the given type to reflect the updated or new field settings. In doing some research to see if someone had already made a module to do such a thing, I came across absolutely nothing and the only tid-bit piece of information that I was able to dig up to help on the issue was located at Jenny & Lin's Blog with some SQL syntaxt to run that will apparently do the updates for the old stuff. (I haven't had time to try this yet...)

My hope is that this request doesn't go unheard this time, as it has in the past because I believe there are folks out there who would love to see this implemented, but like myself (until now), keep quiet in hopes that the foreseen need will not go undetected...

The way I am using a CCK field, where I need the existing updated is in a textarea field where I place adsense code which is then floated to the right side of the node. If I need to make any changes to the code (as I did tonight) I am confident of the changes on all new nodes, but on a website with 800+ classified nodes, I have one of three options: Go in and update each post manually, wait for the post to expire and do nothing about it or try the SQL command to update the existing and hope it doesn't blow up my database...

My suggestion is to have a button, on the cck field edit page, right below the "Default Value" with descriptive text above it that reads something to the nature of: Sync existing xx nodes with the Default Value? and a button that simply states update with a "yes" or "no" confirmation page.
(xx being the number of existing nodes that need updated / synced)

Sorry for the novel... I think I've made my point and would love to see some feedback from the community if I am not the only one who would like to see this happen :)

Comments

Jej’s picture

Hi,

I agree with this feature. Maybe I would call it a minor bug if I knew all the wondefull subtilities of Drupal...

Today I discovered this behaviour concerning the defaut value for a new field on old nodes. I thought it was obvious that Drupal manage that, but after seeing the db it seems fields are created only when they exist in the content type and a new content type node is created. Previous contents are not affected by a new field. When the user create or modify the value, the field is created or updated in field_data_field_xxx. This does not happen when a field is created/edited in the content type, so that all previous records have the default value set regarding the new content structure. We are in a pseudo-relational database model. So a value can be set by the user, or set as the default value when created, or left in an uncertain state (-- None --). After a value is set, it's still possible to set it back to -- none -- (data is deleted from the field_data_field_xxx), except if the field is "requiered".

Maybe the way it works is quite logic in respect to certain use cases or needs. Currently, when a content type evolves, the old records are left in their state, what is not stupid. Maybe it's a mistake to change that. Some drupalers could give their point of view here?

Jej

gagarine’s picture

Because they old node stay with NULL it's impossible to filter a on/off checkbox field with view

#779812: CCK Field as Integer (Single On/Off Checkbox) option not filtering in Views (6.2.9)

KarenS’s picture

Fields are in core in D7. We don't provide features or support for core. It may be that something like this could be provided by a new contrib module, but this is nothing that CCK will be doing.

KarenS’s picture

Status: Active » Closed (won't fix)
JoshOrndorff’s picture

I know this has been closed for a super long time. I just wanted to comment to say that I'm still looking for this feature in D7 fields, and this is the closest I've come to finding it. If anyone has any suggestions, I'd love to hear them.

-Josh

rajesh.vishwakarma’s picture

A fieldupdate module is created for this purpose, currently this is under development.

Issue queue: https://www.drupal.org/node/2420625
Sandbox project: https://www.drupal.org/sandbox/raj_visu/2418411

Guys use this and let me know your feedback.