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.
In filefield_field_update, the code checks if it's processing a new node, and if it is, it returns early as there can't be any old items to delete. The very same check could be used on new node revisions, as the files won't be deleted either and it saves a few cycles not to node_load the original node.
The performance hit isn't huge in normal operations, but bites quite more when batch processing a lot of nodes :-)
Comment | File | Size | Author |
---|---|---|---|
filefield_return_early_on_new_revision.patch | 1 KB | DeFr |
Comments
Comment #1
DeFr CreditAttribution: DeFr commentedI've just checked and the patch seems to still applies cleanly to 3.x-dev (it was made against the 3.0 release), so I guess this needs review :-)
Comment #2
quicksketchMakes sense to me. I should be able to put this in next time I'm applying patches.
Comment #3
quicksketchCommitted. Thanks!