View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0027200||mantisbt||bugtracker||public||2020-09-01 10:17||2020-09-05 15:57|
|Summary||0027200: bugnote_update fires EVENT_BUGNOTE_EDIT but does not clear the note cache|
When a plugin I wrote tried to do something with the updated note, I kept getting the old values.
Suggested fix in bugnote_update.php, right after line 80
|Tags||No tags attached.|
Accessing the global variables directly is not the right way of doing this; you should be calling bugnote_clear_cache() instead, like so:
That being said, to ensure consistent behavior I'm wondering if it would not be cleaner to clear the cache in the bugnote API functions performing updates, i.e. bugnote_set_text(), bugnote_set_time_tracking(), bugnote_set_view_state() and probably bugnote_delete() as well.
The bugnote_clear_cache call, while obviously the way to go instead of meddling with globals, does not remove the entry from the bugnoted_by_id cache structure :( should that be updated in the call as well then?
I didn't actually look at the code, but it sounds like a bug in bugnote_clear_cache().
Here's what happens with bugnote cache functions:
So the logic only works as long as the bugnote has been stored in $g_cache_bugnotes_by_bug_id, but fails in the scenario where the bug-level cache has not been populated.
This can easily be reproduced and confirms the bug :
I opened 0027217 to track the bug in bugnote_clear_cache().
+1 for that
|2020-09-01 10:17||BasCostBudde||New Issue|
|2020-09-01 16:01||atrol||Relationship added||related to 0021876|
|2020-09-02 07:17||dregad||Status||new => feedback|
|2020-09-02 07:17||dregad||Note Added: 0064338|
|2020-09-02 07:17||dregad||Description Updated||View Revisions|
|2020-09-02 10:24||BasCostBudde||Note Added: 0064339|
|2020-09-02 10:24||BasCostBudde||Status||feedback => new|
|2020-09-02 11:01||dregad||Relationship added||related to 0021884|
|2020-09-02 11:02||dregad||Note Added: 0064340|
|2020-09-02 12:25||dregad||Note Added: 0064341|
|2020-09-02 12:33||dregad||Relationship added||related to 0027217|
|2020-09-02 12:33||dregad||Note Added: 0064342|
|2020-09-02 13:04||dregad||Note Added: 0064344|
|2020-09-05 15:57||atrol||Note Added: 0064367|