I have a simple need with using computed field in a view, that it be computed on every view display. The requirement that the computed field must be stored in the database to be able to be used in a view means that the value of the field will not be up-to-update every time someone tries to see the view, as the value is being pulled from the database that was saved last only when the node was created or updated.

The example at hand I have is to compute when a node creation timestamp is before certain time - e.g. 7 days and then compute the field value as "Expired" or something like that. And I need that the field which indicates if the node has expired or not to be up-to-date when the view is being seen.

The support request is to find out if it is possible to render always up-to-date computed value in a view that is created on cck nodes with the computed field.

Comments

tommo’s picture

I too am interested in this issue.

I would like to do many things similar to this and not have to re save the node every time I want the updated data. Could the module have a hook so that it can update the node object prior to it being displayed or used by the view?

I would like to offer my help with this request if it is needed although I would need some guidance. Some pointers at where to start would help me get the ball rolling.

yngvewb’s picture

I also need this. It would have been nice to just say "cache expire after 1/24/48 ... etc hours".

heydere’s picture

I would also be interested in some method of exposing computed fields to views, without relying on node update as the trigger for update. We have calculated data within this field that doesn't change often, but when it does, it needs to be exposed to the views that rely upon it.

ferrangil’s picture

Subscribing!

Justin Freeman’s picture

Assigned: Unassigned » Justin Freeman
Status: Active » Closed (duplicate)

There is one solution which uses a batch update and node_save process see for an example #195013: Recompute all instances of a computed field upon field change

Also there is a patch being developed which may help for views, see #202384: 'view' cell not populated