This fixes the following issues:
#606070: Challenge Displaying User Post on Other User Profile in Activity 2 View
#723294: FBSS and Activity isssue
#681438: using fbss poster doesnt get any activity when posting on another users profile
#657612: "User Picture" field display issues with Activity/FBSS
#680188: cant get the statuses to show similarly to facebooks wall
It does so by adding one more op that identifies when a user posts on someone elses wall. It makes everything clean. There has been no API change that broke this it was always broken.
As a bonus I fixed hook_user($op: 'view').
user_access('edit all statuses', $account)
That means that the $account being viewed must have the edit all statues permission. I do not believe that is what is intended.
Sorry if you frustrated with the API but I told you that this would happen #466590-27: Support Activity 6.2 I just didn't realize the crazy bad extent that would happen.
The patch removes a lot of silly cruft as well around this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | all_activity view export.txt | 8.08 KB | yosisays |
| #22 | Activity_FBSS_Other_test.txt | 15.38 KB | pribeh |
| #8 | User_Activity_Flag_Follow_Like.txt | 14.9 KB | pribeh |
| #6 | fb_fix.patch | 8.01 KB | Scott Reynolds |
Comments
Comment #1
Scott Reynolds commentedI didn't try the tokens so that will need to be tested. I used the Global tokens for the user doing the action and user tokens for the persons wall.
For instance, an activity for when User A posts on User B's wall. I used a template that says [user-name] posted on your wall. You posted on [user] wall. [user-name] posted on [user] wall.
When User A posts on their own wall I used a template that says You updated your status and a public one [user-name] updated their status.
The one minor thing I might add is a form alter to the template form to hide the Poster text area when $op == 'fbss_submitted'
Comment #2
icecreamyou commentedWow, Scott, color me impressed. Thanks for your responsiveness and willingness to help. And yes, you did warn me... I didn't realize the extent to which this would happen either.
I suppose the patch got lost in the nether somewhere along the line? That seems to happen not infrequently on d.o...
Comment #3
jjohn commentedhi,
i'm still not good in this...hope you can simlpify. =)
how would i apply the fix mentioned above?
thanks very much!
Comment #4
ocamp commentedjjohn i think there was supposed to be a patch, that will follow soon.
Comment #5
pribeh commentedColour me thrilled (trice no less) since I'm Canadian.
Comment #6
Scott Reynolds commentedlol so tired last nite didn't post the patch..
Comment #7
icecreamyou commentedLooks good, there are some strings that should be changed but I will commit this as soon as I can -- no later than Saturday I hope.
Comment #8
pribeh commentedThanks so much for your hard work on this patch Scott.
So I'm not entirely sure if I should post this issue hear or in thread #657612. But in regards to my issue in #657612 I've patched the latest FBSS-dev (from the 25th) with fb_fix.patch from #6. I've setup a view (see attached) utilizing the "user: picture" field to try and display both the user picture of the poster of a status along with the author of nodes. Unfortunately, the view still displays the user picture of the status' "owner". I've tried some variations but to no avail. Could someone check out my view to see if I'm going about building the view incorrectly?
[edit] Oh, I should add that I've rebuilt the Activity Access Table and cleared caches as well.
Thanks!
Thomas
Comment #9
icecreamyou commented@pribeh: so let me explain http://drupal.org/node/657612#comment-2633984 a little more if I may:
Activity's database tables store a message associated with one UID. In FBSS' case, the UID stored is that of the recipient of a status message. The ID of the status object is also stored, and this could be used to retrieve the poster's UID, which could in turn be used to retrieve the $account object necessary to display the poster's picture. However, that would require two database queries per row rendered in a View.
However, Scott obviously knows more about how Activity works than I do, and he says:
...so perhaps I should just stay quiet on my theories and let Scott explain a better way. :)
Comment #10
Scott Reynolds commentedSo with this patch, the User: Picture field will always be the person who did the action.
It does not fix existing records though.
edit: to clarify, this patch puts the uid of the 'doer' of the activity into the activity table. This preserves the activity atomic record to reflect the doer, the type and when it happened. The other tables control who sees what message.
Comment #11
pribeh commented[edit]
Thanks for the quick response guys.
So according to Scott, from what I understand, the poster's user picture should display, being the one who commits the action.
Well, I went ahead and did some testing based upon that assumption. I reinstalled Activity 2.x, re-generated activity for the site (using the module from #6 here http://drupal.org/node/463854), rebuilt the access tables. I even created a publisher template for the new "wall post" status prior to generation. unfortunately, the user picture of the FBSS owner still displays where the poster's picture should.
however, I also simply tried posting new statuses onto other users' profiles/walls and ... voila, it works!
So I guess the "records" that need fixing are FBSS records and not Activity ones then. Not sure if this should be filed as an issue as I'm not sure if it's important enough to have previous/old "wall" statuses display their associated posters' pictures correctly in this way. It would be nice but ... I'll leave that up to you guys. I'm super happy this works now. Thanks guys!
Comment #12
icecreamyou commentedHmm. No idea why that would be, but thanks for testing, pribeh.
If this is a serious issue -- or if anyone else finds any immediate issues -- I would very much like to hear about them (in this thread is fine) before I commit the patch. (I'm out of time tonight and tomorrow is looking increasingly less likely but I will get to it by Saturday for sure. I hope.)
Comment #13
Scott Reynolds commentedRe @11:
Yes I mentioned that this will not fix existing records in comment 10.
SQL should be pretty straight forward just update the activity.uid field with the uid of the user that does the action.
Comment #14
pribeh commented@13 Oh great, thanks again Scott.
Comment #15
SamSound commentedThanks for the patch and the work
i tried the patch, when i view all activity its seems to be working ok, the users now have their correct pictures.
But when i add Activity Access: Activity Context User. I only get the statuses the user has posted and not what the users had posted on their profile. ive tried default arguments, user id from url and user id from logged in.
Im sure I used to get both status updates done by the user and done to the user with this view, is it supposed to be like this?
Comment #16
Scott Reynolds commented@samSound using that argument, use also both of the Activity Access filter for FBSS. That should fix that.
Comment #17
icecreamyou commentedReviewing the patch right now...
Here's what was up with the hook_user() thing. That line checks for the following:
That last one is the part in question. The assumption was that if a user has permission to edit all statuses then they also have permission to have their own status even if they don't explicitly have permission to edit their own status. However on reflection that sounds kind of weird so I just took out the
user_access('edit all statuses', $account)altogether.When going to create a new Activity publisher template, under "Available Activity Types" is listed "Facebook status." There must be some weird transformation of "facebook_status" going on there, which is not ideal since there is a module called "Facebook status" (fbstatus) and it is not this one.
No description of the new trigger was added in the patch. I added one.
I added the suggested form alter to remove the Poster field for the self-update trigger.
...committed! Will be in the next dev. Thanks for your work on this Scott.
Comment #18
pribeh commentedHi Ice,
I'm not sure if I should open this as a separate issue or not.
I presume your changes were committed to the Monday 03-01-2010 FBSS dev since I tested it out and found some of the changes present. Here's my experience with that build:
- When saving the FBSS Activity Access Control both "poster" and "owner" remained checked.
- The FBSS Activity Publisher template consisted simply of an owner and poster form of which the owner form appeared blank.
- After submitting the Activity Publisher template with a [themed-status] token, adjusting views to contain the Activity Access filter for FBSS, I experienced the following:
When submitting a status on another user's profile the status does not display on either the owner's wall or the poster's wall whether viewed by the owner or the poster.
I'm going to run a few more tests and export the views I'm working with later and provide another update.
Comment #19
Scott Reynolds commentedInteresting, and you are using those access controls on the View right?
Comment #20
icecreamyou commentedpribeh, I'm pretty sure I fixed that in #728576: can only get fbss posts by the user and not posts done to user, you may have just gotten a dev from before that change got in
Edit: Actually, your problem looks a little different. But I've tested the changes and they work as I expect, so it's weird that you would get a different result.
Comment #21
pribeh commentedProblem solved. Looks like since I upgraded from the patched version of the previous FBSS build to the March 1st FBSS edition I had to delete the previous Activity Publisher template for "other" and create a new one.
Comment #22
pribeh commentedOk, sorry, I must be missing something here. I've attached the view I'm working with. I thought I fixed the problem. The statuses now appear but they're no longer displaying the "poster" picture but the "owner's" picture. So I've done this a couple times now (reverting back each time) just to make sure I'm not missing anything here. I can get a patched build of FBSS (previous to March 1st) to work just fine but I can't get the latest build to work as desired.
- I've setup an Activity PT for both status updates and those posted on other's profiles.
- I've checked off the FBSS related Access Controls, rebuilt them.
- I've made sure to include the "Activity Access: Facebook Status .." for both owner and poster.
I wish I could provide more info.
Comment #23
icecreamyou commentedConfirmed. But this should be the only relevant difference between the patched version and the current dev, and that was necessary to solve #728576: can only get fbss posts by the user and not posts done to user.
By the way, I'll be AFK for 5 days and then unable to commit anything for 3 days starting Saturday and I'll have a lot to catch up with when I get back so if this fix doesn't get in by Friday night it will be delayed at least 2 weeks.
Comment #25
icecreamyou commented@pribeh, I think at this point your problem belongs in another issue, although I'd still love Scott's input.
Comment #26
pribeh commentedI'll start another issue.
Comment #27
jjohn commentedhi,
i tried to use the patch (@#6), but i was asked what file to patch...
please see result below:
++++++++++++++++++++++++++++++++++++++++++++++++++++
patch -p0 < /home/fireofgo/public_html/develop/fb_fix.patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: facebook_status.module
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/facebook_status.module,v
|retrieving revision 1.5.6.94
|diff -u -p -r1.5.6.94 facebook_status.module
|--- facebook_status.module 24 Feb 2010 21:51:54 -0000 1.5.6.94
|+++ facebook_status.module 25 Feb 2010 05:41:38 -0000
--------------------------
File to patch:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
am i doing the right way?
Comment #28
jjohn commentedhi,
i tried to use the patch (@#6), but i was asked what file to patch...
please see result below:
++++++++++++++++++++++++++++++++++++++++++++++++++++
patch -p0 < /home/fireofgo/public_html/develop/fb_fix.patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: facebook_status.module
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/facebook_status/facebook_status.module,v
|retrieving revision 1.5.6.94
|diff -u -p -r1.5.6.94 facebook_status.module
|--- facebook_status.module 24 Feb 2010 21:51:54 -0000 1.5.6.94
|+++ facebook_status.module 25 Feb 2010 05:41:38 -0000
--------------------------
File to patch:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
am i doing the right way?
Comment #29
SamSound commentedthe latest dev has already been patched
Comment #30
jjohn commentedhi SamSound,
thanks for the info!
At last! it's working now!
thanks also to pribeh and scott for the unceasing support... =)
such a great module!
Comment #31
yosisays commentedI’m using the latest dev and I’m still not seeing the fbss activity in the feed/view. I set up the fbss activity using the activity publisher template but its not showing up in the activity view. This is the export of my view; do I have something set up wrong?
Comment #32
yosisays commentedanyone?
Comment #33
yosisays commentedI would be very grateful if someone would be able to assist me with my issue in #31. Thanks in advance!
Comment #34
icecreamyou commented@yosisays: Nice Level 5 Necrobump. This issue is closed and your issue is unrelated (you have a support request, while this issue was about updating FBSS to comply with API changes in Activity 2.x that were made 5 months ago). Please don't hijack closed and/or unrelated issues. But feel free to open a new issue.