Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2013 at 00:15 UTC
Updated:
3 Jul 2013 at 22:50 UTC
Jump to comment: Most recent file
Resetting an entity_load cache bin in Drupal 7 can have more drastic consequences than in previous versions of Drupal, as we can have persistent load caches in place of the PHP static memory cache.
Instead, wherever possible, only flush the necessary entities from the cache, using entity_get_controller($entity_type)->resetCache(array($entity_id));
In this case, webform_node_update() can use entity_load_unchanged() to re-generate the specific node in question, without wiping out the entire node load cache.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_update_efficiency-1963996.patch | 655 bytes | quicksketch |
| #1 | webform-entity_load_cache_reset-1963996.patch | 653 bytes | jweowu |
Comments
Comment #1
jweowu commentedComment #2
quicksketchActually I think a safer/faster way of handling this yet is just to use $node->original if it exists, since in D7 this variable is pre-populated for you already in calls to node_update.
For reference, the original call was added in #1009226: The roles allowed to access a webform don't get saved to the database correctly, in which I don't think either james.elliott or I knew about this property at that time.
Comment #3
quicksketchComment #4
jweowu commentedAh, yes indeed.
node_save()populates that usingentity_load_unchanged(), so that's definitely the sensible solution.Comment #5.0
(not verified) commentedCross-referencing with core API issue