Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use computed fields on my users. It works fine but the method user_save
won't update these fields. The only way I have to make it refresh is to save manually the user.
Comments
Comment #1
Kodiak CreditAttribution: Kodiak commentedI'm sorry to insist but am I the only one experiencing that? Am I doing something wrong? Is there a workaround?
Comment #2
sockeye CreditAttribution: sockeye commentedI'm having a problem that sounds like it may be the same thing. I'm trying to use a computed field in a taxonomy term display. When I add the computed field it gives me starting values for Computed Code and Display Code. Whatever I put in those fields (including leaving them unchanged) doesn't seem to have any effect. When I click Save Field Settings I am returned to the same screen with the two code blocks unchanged from their original default values.
Comment #3
Kodiak CreditAttribution: Kodiak commentedSorry, I found my mistake.
I was calling
user_save
from ahook_node_update
. So the data was not stored in DB yet when computed field tried to do its job.I would appreciate if someone could tell me how to trigger the update of the computed field (with
user_save
) AFTER the data on which it depends is updated.