Closed (fixed)
Project:
Delayed ownership
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2013 at 20:30 UTC
Updated:
26 Jul 2013 at 09:31 UTC
Jump to comment: Most recent file
me again.
We had some issues because of caching mechanisms on node. uid was correctly written to database, but as soon as node was saved via interface it became anonymous again. This seems to be because of caching mechanisms.
Hard workaround would be my patch attached, which works, but I am not sure, whether flushing all caches really is the best variant. I'd like to only clear page cache (like in _admin_menu_flush_cache() case 'cache'). Perhaps we should just duplicate this piece of code (I know, c&p is root of all evil...).
I'd love to hear some feedback on this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | delayed_ownership-flush_caches_on_assignment.patch | 764 bytes | smussbach |
| delayed_ownership-flush_caches_on_assignment.patch | 395 bytes | smussbach |
Comments
Comment #1
smussbach commentedWith my patch above all caches are flushed any time a user logs in, which is clearly not desirable. Fixed it with this patch
Comment #2
organicwire commentedI cannot reproduce this issue. Can you provide more information about
Generally, if avoidable, clearing caches seems a bad idea to me. On big sites we'd have serious performance issues. Another approach would be to tell the caching system that the specific node or a specific form did change.
Comment #3
smussbach commentedI absolutely agree that flushing caches is generally a bad idea. It would be much better to flush only nodewise. I did not find any possibility to do this. Today I found following which might be usable (needs entity API).
I can reproduce it on every node insert, I try to figure my settings out.
* Cache: entity cache module enabled, otherwise no cache configured
* I use a general add form similar to /node/add/[type], nothing via panels
* Reproduce: Add node anonymously, login, node is transferred (uid correctly set in db). As admin go to Menu -> Content. Username is correctly displayed. Edit node. Authoring information is Anonymous. Tab devel $object->uid = 0. On save, node uid is set back to 0 in db
I am very interested, whether you can reproduce it. If not, my bugfix (or better "hotfix"?) with clearing the cache is only because of some side effects.
Comment #4
organicwire commentedAlright, I can reproduce the bug.
I don't have this behaviour if I disable entitycache. I assume that the problem is how we assign the new authorship. Instead of using the node module, we directly write into the database. So neither cache or entity modules know about the node change.
Fix: Use node_save() instead of db_update. What do you think?
Comment #5
smussbach commentedyes, this really sounds reasonable! Way better to use node_save().
Comment #6
organicwire commentedHi Sami, eventually this bug is fixed.
Comment #7.0
(not verified) commentedtypo