Active
Project:
Dynamic Field
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2009 at 19:46 UTC
Updated:
2 Dec 2010 at 21:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
sourcen commentedComputedField computes the value while the node is added and saves in the DB but this module doesn't save any info in DB... values are computed whenever the node is rendered in the frontend
Comment #2
owen barton commentedSorry, I am pretty sure this is actually duplicate - Computed Field can store the result in the database, but you can also tell it to not do this and instead recompute it on each view using the checkbox on the field configuration form:
From http://drupal.org/node/149225:
Comment #3
andyhu commentedI think the current computed_field module doesn't work well with CCK 6.x-2.1. In the current version of CCK, the hook of hook_field with op = 'load' will not be invoked each time you view the node by default if the node is cached. It should use 'sanitize' as op for dynamic fields. Anyway, computed field doesn't work with Views if you don't want to store the computed value to database. If you can get this module working with Views, it would be quite useful!
Comment #4
robloachInstead of saying something is broken, and then making an entirely whole new module for it, it's usually better to help fix the thing that's broken.
Computed Field doesn't show values in Views if you don't store them in the database because if you did display them, it would be a huge performance hit. Storing the values in the database gives you speed.
Comment #5
dpearcefl commentedJust a comment:
There are good reasons for this module to continue. I needed a field to be calculated when viewed to give me a date corresponding to "the first Thursday of March in the current year". Storing the date will not work for me if the field does not get recalculated but once.
Keep up the good work.
Comment #6
aren cambre commentedMaking the title more direct.
Comment #7
pepe roni commentedI also found out that computed field currently does not work as desired, as computed values get not recalculated on node view but only on node save, even if the values are not stored in the database. So when I found this module I thought it could solve my problems. If you look into the usage statistics you will see there is really a need for this functionality. And after thinking about its target to solve the problem, I also think, it indeed is a duplicate of computed field, because it does something, computed field should do (or users think it should do).
So, please help the maintainers of computed field to solve the problem instead of creating a new module.
BTW. I downloaded the module with
drush dl computedfieldand then tried to enable the module withdrush enable computedfieldbut the latter command failed. I looked into the module and saw that is was named phptext inside! What the hell does phptext have to do with dynamic field?Drush? Check this: http://drupal.org/project/drush
Comment #8
joelstein commentedFYI, there is yet another module which accomplished this main objective of this module: Views Custom Field.
Comment #9
vacilando commentedSo far I am forced to use Dynamic Field because Computed Field indeed does not re-calculate values except on save (see this issue: http://drupal.org/node/598582). Subscribing.
Comment #10
roball commentedThe "Views Custom Field" module is entirely different from "Computed Field" because it does *not* provide a new CCK field type, so it cannot be used to add custom fields to nodes. It can only be used to add custom View fields to be displayed in Views.
Comment #11
Pedro Lozano commentedHere is a demo.
Code for dynamic field (PHP Code):
Code for computed field ("Display format"):
Computed field configured not to store the values in database.
Results in the attached image. Both fields al always recalculated correctly with the same results.
NO, you don't have to edit the node for the computed field to be recalculated.
It's just the views integration what does not work on Computed. A simple patch should have solved it.
Comment #12
jfine commentedIt's my understanding computed field can't access $node in "Display format". I'm trying to add a computed field for a simple widget that pulls in some info based on node id ($node->nid). This functionality is the fundamental difference (and in my opinion a failure) between computed field and others. Although computed field would work, touching or re-saving all my content just won't work.
Comment #13
Pedro Lozano commentedActually it can. It's just in $element['#node'].
The cvs version already can access $node directly.
Comment #14
jfine commentedAh, cool. Guess very shortly dynamic field will be obsoleted by computed field then.
Comment #15
roball commentedHm, accessing $node as Display code did not work for me (using the latest dev version). Did you succeed, Pedro?