Skip to:

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6596 closed defect (bug) (no action required)

bp_notifications_mark_notification not clearing cache

Reported by: thomaslhotta's profile thomaslhotta Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords: reporter-feedback
Cc: th.lhotta@…


Because bp_notifications_mark_notification does not pass the user ID in $where_args to BP_Notifications_Notification::update the notification cache is not cleared. This is a problem when using persistent object caches as it means the cache has to be cleared manually.

Additionally the doc of bp_notifications_mark_notification seems to be wrong as the $id parameter is the notification ID and not the user ID.

Attachments (1)

6596.diff (1.4 KB) - added by boonebgorges 9 years ago.

Download all attachments as: .zip

Change History (7)

#1 @thomaslhotta
9 years ago

  • Cc th.lhotta@… added

#2 @boonebgorges
9 years ago

In 10055:

Fix parameter documentation for bp_notifications_mark_notification().

Props thomaslhotta.
See #6596.

#3 @boonebgorges
9 years ago

  • Keywords reporter-feedback added

thomaslhotta - Thanks for the report. I've fixed the documentation issue in [10055].

I can't reproduce the cache problem you're reporting. See bp_notifications_clear_all_for_user_cache_before_update(). It's true that, in this case, no 'user_id' is passed. But this means that the elseif ( ! empty( $where_args['id'] ) ) clause is triggered, which also clears the user cache. See 6596.diff for a unit test.

9 years ago

#4 @thomaslhotta
9 years ago

Sorry, my error. I'm still on 2.2. This was fixed in 2.3.

#5 @boonebgorges
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Cool - thanks for reporting back!

#6 @DJPaul
8 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.