Field is recomputed on render in Views

Created on 14 March 2024, 7 months ago

We have a computed field that has a fairly expensive compute function, so we only want to recompute it on node save.

(Still using Computed Field 3.x in order to store field values in the DB, and using the computed_field_FIELD_compute() hook to recompute on node save.)

When using this field in a view, though, the view takes ages to render because the field is being recomputed on render.

executeCode() is being called by getRawResult() which is being called by isEmpty().

Is there a reason that isEmpty() needs to re-compute the field?

I see #2663140: Empty value still shows label β†’ where @colan added executeCode() to isEmpty(). When using CF to actually store field data can't we test the value straight from the database?

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jeffschuler Boulder, Colorado

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024