Closed jazzsequence closed 9 years ago
...which is really weird because this returns an array of IDs:
var_dump(mpp_activity_get_attached_media_ids($activity->id));
This line appears to be the issue:
https://github.com/buddydev/mediapress/blob/master/core/activity/template.php#L165
apply_filters
is being run twice. PR forthcoming.
Hi Chris, Please give me an hour . I am looking into it. Most probably it is caused by mpp_activity_get_attached_media_ids()
PR #17
Hi, The problem is if we remove that filter, It will not change the action for the upload to groups as you can see here. https://github.com/buddydev/mediapress/blob/master/modules/groups/hooks.php#L69
Finally found the issue. On line 153 , we are popping the media ids array to fetch one of the media https://github.com/buddydev/mediapress/blob/master/core/activity/template.php#L153
and this is causing the actual count to decrease by 1.
That makes sense. I will look for the update. I'm not familiar with array_pop
so I didn't pay much attention to it. :)
Fixed in 8569e247e547ddf
:+1: This looks good, too.
Thank you :)
This appears to be coming from this line: https://github.com/buddydev/mediapress/blob/master/core/activity/template.php#L152
...except that when I var_dump
$media_ids
I get an empty array, so the count is always 0.