When the entity cache module is enabled and the user edits the node registrations configuration form (eg. node/!node/node_registration/settings), the new settings are not shown immediately.

I believe node data has not been updated in the cache, the form uses the $node->registration property and the old values are displayed on form.

I made a little patch that solved my problem, but it is necessary to test it better..

Comments

gerson.analista created an issue. See original summary.

gerson.analista’s picture

StatusFileSize
new680 bytes
gerson.analista’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: entity-cache-compatibility-2943301-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

rudiedirkx’s picture

NR adds registration in hook_node_load, which should not be cached. Is that what entitycache does? Cache the result of hook_node_load? That would be very unDrupal...

rudiedirkx’s picture

Category: Bug report » Feature request
Status: Needs work » Closed (won't fix)
Issue tags: -cache

Looking at the source code, I don't see where/when entities are cached, but I do understand it caches after hook_node_load.

I see 2 options:

  • They have a hook for after-cache loading, like hook_node_load works without entitycache.
  • They seem to clear the cache when a node is saved, which sounds sensible, but NR settings can be in a node type, and saving all nodes is too expensive.

I don't think NR should do anything. If entitycache breaks how hook_node_load is supposed to work, it should fix it, but it won't, because that's the entire point of entitycache. The only party that used both modules, and knows their interaction, is you, the website's developer, so only you should fix this.

Implement hook_entitycache_load (should always come after hook_node_load, also for uncached entities) to override $node->registration. Docs here.

NR could do that, but that would be strange, because it doesn't use entitycache.

gerson.analista’s picture

thanks for the explanation.