[buddypress-trac] [BuddyPress Trac] #3794: Deleted activity items remain favourited
buddypress-trac
noreply at wordpress.org
Sun Aug 7 07:42:19 UTC 2016
#3794: Deleted activity items remain favourited
--------------------------+------------------
Reporter: ewebber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.7
Component: Activity | Version: 1.2
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+------------------
Comment (by imath):
@boonebgorges sure. I understand green or red mountains can be annoying on
trac, i won't build them anymore!
About the strategy, we've been discussing about it since 2.1 with no
results. We're working on 2.7.
Here's some reminders:
- 21 months ago use the activity table:
[https://buddypress.trac.wordpress.org/attachment/ticket/3794/3794.03.patch
3794.03.patch]
- 7 months ago: use a BP Object Relationship Table:
[https://buddypress.trac.wordpress.org/attachment/ticket/3794/3794.04.patch
3794.04.patch]
There's always a good reason not to fix this issue.
- 03.patch favorite count update was problematic
- 04.patch was suggesting the 'item-to-item relationship API' you
mentioned and i'm pretty sure nobody looked at it, and i assumed migrating
favorites needed #6841 to be solved first.
- 05.patch wpdb->usermeta is subject to "bloating and poor performance due
to plugins that put lots of data in there"
So i think your strategy is wrong because as you said 5 years ago on this
ticket:
> Unfortunately it'll be next to impossible to solve. We currently store a
user's activity favorites in usermeta as an array. There's no way to query
(eg) how many times an activity item has been favorited, or by whom. So
there's no way to loop through those users and delete the item from the
activity favorites list
And what you're doing is adding another serialized array into the activity
meta. So it will be problematic one of these days. And somehow you're
suggesting something that will have the same problem than 03.patch when
updating the users favorites.
I see 2 alternatives:
- have one line per user into the activity metas which is actually moving
the performance issues you mentioned about $wpdb->usermeta into the
activity meta. But maybe there are less plugins using it.. Then we could
use similar functions to the two green mountains i've added in 05.patch
(`bp_get_meta_by_key_value()` and `bp_delete_meta_by_key_value()` btw it's
amazing it's not possible to have object/meta ids given a meta_key and a
meta_value in WordPress!!)
- Leave the things the way they are but move the code into bp-activity-
favorites.php so at least we can filter bp_is_active( 'activity',
'favorites' ) and avoid loading some code that is failing anyway...
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3794#comment:40>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list